![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
grunt-mustache-combine
Advanced tools
Combine Mustache templates into one file.
This 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.
$ npm install --save-dev grunt-mustache-combine
require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks
grunt.initConfig({
mustache_combine: {
all: {
files: 'js/templates.js': ['templates/**/*.mustache']
}
}
});
grunt.registerTask('default', ['mustache_combine']);
grunt.initConfig({
mustache_combine: {
options: {
format: 'amd',
extension: '.html',
removeFromKey: 'path/to/'
},
all: {
files: 'dist/templates.js': ['path/to/templates/**/*.html']
}
}
});
Type: String
Default: 'es6'
Other possible values: 'commonjs', 'amd', 'es5'
The format to output.
Type: String
Default: '.mustache'
The extension to remove from the key.
Type: String
Default: ''
Part of the file path to remove from the key.
Type: Boolean
Default: true
Generate lower case keys. Set to false
to ignore casing.
Type: Function
Default: null
Function to generate a custom key. It overrules the removeFromKey
and useLowerCaseKey
options and receives the file path as a parameter.
grunt.initConfig({
mustache_combine: {
options: {
formatKey: function(filepath) {
return filepath
.replace('path/to/templates/', 'tpl-')
.toUpperCase();
}
},
all: {
files: 'js/template.js': ['path/to/templates/**/*.mustache']
}
}
});
// Contents of the generated templates file (default ES6 format)
export default {"my/template": "<h1>hello {{name}}</h1>"};
// In your module.js
import Mustache from 'mustache';
import templates from './templates';
const tpl = templates['my/template'];
Mustache.render(tpl, {name: 'World'});
MIT © VI Company
FAQs
Combine Mustache templates.
We found that grunt-mustache-combine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.