grunt-inline-template
inline-template in a grunt plugin.
Best used with karma-inline-template for testing.
Usage
Install from npm:
npm install grunt-inline-template --save-dev
Load in gruntfile:
grunt;
Have javascript source wanting a template:
var myTemplate = '<%= inlineTemplate("templates/my-template.html") %>';
Then have this in your Gruntfile:
grunt.initConfig({
inlineTemplate: {
options: {
base: 'src'
},
dist: {
src: ['src/**/*.js'],
dest: 'dist/build.js'
}
}
});
Options
base
Type: String
Default: .
The base directory to read templates from For example, could be 'src'
.
doubleQuote
Type: Boolean
Default: false
Whether to escape single quotes or double quotes in the template. Defaults to escaping single quotes.