node package manager


A grunt plugin. Uses inline-template to put html templates in your javascript.


inline-template in a grunt plugin.

Best used with karma-inline-template for testing.

Install from npm:

npm install grunt-inline-template --save-dev

Load in gruntfile:


Have javascript source wanting a template:

var myTemplate = '<%= inlineTemplate("templates/my-template.html") %>';

Then have this in your Gruntfile:

  inlineTemplate: {
    options: {
      base: 'src'
    dist: {
      src: ['src/**/*.js'],
      dest: 'dist/build.js'

Type: String Default: .

The base directory to read templates from For example, could be 'src'.

Type: Boolean Default: false

Whether to escape single quotes or double quotes in the template. Defaults to escaping single quotes.