{"id":16693852,"url":"https://github.com/deepsweet/mustache-loader","last_synced_at":"2025-03-17T00:33:22.728Z","repository":{"id":20895489,"uuid":"24182977","full_name":"deepsweet/mustache-loader","owner":"deepsweet","description":"Mustache loader for webpack","archived":false,"fork":false,"pushed_at":"2019-02-09T15:43:19.000Z","size":54,"stargazers_count":39,"open_issues_count":4,"forks_count":31,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T15:32:34.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepsweet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-18T09:55:18.000Z","updated_at":"2023-06-28T15:30:07.000Z","dependencies_parsed_at":"2022-07-26T12:47:00.510Z","dependency_job_id":null,"html_url":"https://github.com/deepsweet/mustache-loader","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsweet%2Fmustache-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsweet%2Fmustache-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsweet%2Fmustache-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsweet%2Fmustache-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepsweet","download_url":"https://codeload.github.com/deepsweet/mustache-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243835942,"owners_count":20355611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T16:32:40.823Z","updated_at":"2025-03-17T00:33:22.484Z","avatar_url":"https://github.com/deepsweet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Mustache loader for [webpack](https://webpack.github.io/)\n\n[![npm](http://img.shields.io/npm/v/mustache-loader.svg?style=flat-square)](https://www.npmjs.org/package/mustache-loader)\n[![travis](http://img.shields.io/travis/deepsweet/mustache-loader.svg?style=flat-square)](https://travis-ci.org/deepsweet/mustache-loader)\n[![climate](http://img.shields.io/codeclimate/github/deepsweet/mustache-loader.svg?style=flat-square)](https://codeclimate.com/github/deepsweet/mustache-loader/code)\n[![peer deps](http://img.shields.io/david/peer/deepsweet/mustache-loader.svg?style=flat-square)](https://david-dm.org/deepsweet/mustache-loader#info=peerDependencies)\n[![dependencies](http://img.shields.io/david/deepsweet/mustache-loader.svg?style=flat-square)](https://david-dm.org/deepsweet/mustache-loader#info=dependencies)\n\nCompiles [Mustache](https://mustache.github.io/) templates with [Hogan](https://twitter.github.io/hogan.js/) and optionally [html-minifier](https://github.com/kangax/html-minifier).\n\n### Install\n\n```sh\n$ npm i -S mustache-loader\n```\n\n### Usage\n\nwebpack@1.x\n```javascript\nmodule: {\n    loaders: [ {\n        test: /\\.html$/,\n        loader: 'mustache'\n        // loader: 'mustache?minify'\n        // loader: 'mustache?{ minify: { removeComments: false } }'\n        // loader: 'mustache?noShortcut'\n    } ]\n}\n```\nwebpack@2.x\n```javascript\nmodule: {\n    rules: [ {\n        test: /\\.html$/,\n        loader: 'mustache-loader'\n        // loader: 'mustache-loader?minify'\n        // loader: 'mustache-loader?{ minify: { removeComments: false } }'\n        // loader: 'mustache-loader?noShortcut'\n    } ]\n}\n```\n\n```javascript\nvar template = require('./template.html');\nvar html = template({ foo: 'bar' });\n```\n\nIf `noShortcut` is passed, then Hogan compiled template is returned instead, so\nyou can pass it as partial.\n\n```javascript\nvar template = require('./template.html');\nvar template2 = require('./template2.html');\nvar html = template.render({ foo: 'bar' }, {partial: template2});\n```\n\nIf `clientSide` is passed in, then Hogan will not pre-compile the template.\n\nIf `tiny` is passed in, the source of the template will not be emitted, creating a smaller output.\n\nif `render` is passed in, the data is sent is used to immediately render the template.  Render may be an object or a function which returns an object (in order to allow the data to change over time, e.g. to support hot reloading).\n\nFor example, the following will render `index.mustache` with the provided data (`title`), which can immediately be used by HtmlWebpackPlugin.\n\n```javascript\nmodule: {\n    rules: [ {\n        test: /index\\.mustache$/,\n        loader: 'mustache-loader',\n        options: {\n            tiny: true,\n            render: {\n                title: 'hello world',\n            },\n        },\n    } ]\n}\nplugins: [\n    new HtmlWebpackPlugin({\n        template: 'index.mustache',\n        inject: 'body',\n    }),\n]\n```\n\nIf another loader is chained after Mustache-Loader then the `minify`, `clientSide`, and `tiny` options will be ignored.\n\nAny additional Hogan parameters passed into this loader will be passed through to Hogan.\n\n[Documentation: Using loaders](https://webpack.github.io/docs/using-loaders.html).\n\n### License\n[WTFPL](http://www.wtfpl.net/wp-content/uploads/2012/12/wtfpl-strip.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepsweet%2Fmustache-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepsweet%2Fmustache-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepsweet%2Fmustache-loader/lists"}