{"id":19150437,"url":"https://github.com/vicompany/grunt-mustache-combine","last_synced_at":"2025-07-19T16:03:51.479Z","repository":{"id":43205404,"uuid":"50586015","full_name":"vicompany/grunt-mustache-combine","owner":"vicompany","description":"Combine Mustach templates","archived":false,"fork":false,"pushed_at":"2016-04-05T11:25:27.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-30T06:43:45.720Z","etag":null,"topics":["grunt-task","mustache"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vicompany.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":"2016-01-28T13:50:10.000Z","updated_at":"2018-12-21T10:55:47.000Z","dependencies_parsed_at":"2022-09-04T14:40:52.749Z","dependency_job_id":null,"html_url":"https://github.com/vicompany/grunt-mustache-combine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicompany%2Fgrunt-mustache-combine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicompany%2Fgrunt-mustache-combine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicompany%2Fgrunt-mustache-combine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicompany%2Fgrunt-mustache-combine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vicompany","download_url":"https://codeload.github.com/vicompany/grunt-mustache-combine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240236202,"owners_count":19769572,"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":["grunt-task","mustache"],"created_at":"2024-11-09T08:12:01.498Z","updated_at":"2025-02-22T20:46:08.062Z","avatar_url":"https://github.com/vicompany.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-mustache-combine [![Build Status](https://travis-ci.org/vicompany/grunt-mustache-combine.svg?branch=master)](https://travis-ci.org/vicompany/grunt-mustache-combine)\n\n\u003e Combine Mustache templates into one file.\n\n## Getting Started\n\nThis plugin will combine all your Mustache templates into one file (`object`) and use the path of the file as the key. It won't pre-parse the file, because Mustache will [do that on the first render](https://github.com/janl/mustache.js#pre-parsing-and-caching-templates).\n\n## Install\n\n```\n$ npm install --save-dev grunt-mustache-combine\n```\n\n## Usage\n\n```js\nrequire('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks\n\ngrunt.initConfig({\n  mustache_combine: {\n    all: {\n      files: {\n        'js/templates.js': ['templates/**/*.mustache']\n      }\n    }\n  }\n});\n\ngrunt.registerTask('default', ['mustache_combine']);\n```\n\n## Examples\n\n### Custom config and rules\n\n```js\ngrunt.initConfig({\n  mustache_combine: {\n    options: {\n      format: 'amd',\n      extension: '.html',\n      removeFromKey: 'path/to/'\n    },\n    all: {\n      files: {\n          'dist/templates.js': ['path/to/templates/**/*.html']\n      }\n    }\n  }\n});\n```\n\n## Options\n\n### options.format\nType: `String`\nDefault: `'es6'`\nOther possible values: `'commonjs', 'amd', 'es5'`\n\nThe format to output.\n\n### options.extension\nType: `String`\nDefault: `'.mustache'`\n\nThe extension to remove from the key.\n\n### options.removeFromKey\nType: `String`\nDefault: `''`\n\nPart of the file path to remove from the key.\n\n### options.useLowerCaseKey\nType: `Boolean`\nDefault: `true`\n\nGenerate lower case keys. Set to `false` to ignore casing.\n\n### options.formatKey\nType: `Function`\nDefault: `null`\n\nFunction to generate a custom key. It overrules the `removeFromKey` and `useLowerCaseKey` options and receives the file path as a parameter.\n\n```js\ngrunt.initConfig({\n  mustache_combine: {\n    options: {\n      formatKey: function(filepath) {\n        return filepath\n          .replace('path/to/templates/', 'tpl-')\n          .toUpperCase();\n      }\n    },\n    all: {\n      files: 'js/template.js': ['path/to/templates/**/*.mustache']\n    }\n  }\n});\n```\n\n## Output example and usage\n\n```js\n// Contents of the generated templates file (default ES6 format)\nexport default {\"my/template\": \"\u003ch1\u003ehello {{name}}\u003c/h1\u003e\"};\n\n// In your module.js\nimport Mustache from 'mustache';\nimport templates from './templates';\n\nconst tpl = templates['my/template'];\n\nMustache.render(tpl, {name: 'World'});\n```\n\n## License\n\nMIT © [VI Company](http://vicompany.nl)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvicompany%2Fgrunt-mustache-combine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvicompany%2Fgrunt-mustache-combine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvicompany%2Fgrunt-mustache-combine/lists"}