gulp-ng-template-strings
Inline angular templates into directive definition objects
Install
npm i --save-dev gulp-ng-template-strings
Example
Pass the plugin js files containing templateUrl
properties to have them
replaced with template
properties.
gulpfile.js
var gulp = ;var ngTemplateStrings = ; gulp;
Input files
src/tab.js
{ return templateUrl: 'templates/tab.html' ;}
templates/tab.html
Tab
Output file
dist/tab.js
{ return templateUrl: '<ul><li>Tab</li></ul>' ;}
API
All options can be passed on stream creation.
cwd
By default the plugin looks for files based of the file.cwd
of each file
passed through. This option overrides that for all files passed to a stream.
minify
Your html strings will be minified with html-minifier. You can override our default configuration by passing a minify object in the settings object.
By default we use the following options:
removeComments: true // remove html comments removeCommentsFromCDATA: true // removes comments from inline JS & CSS collapseWhitespace: true // collapse whitespace in text nodes caseSensitive: true // preserve case in attributes // all other options use html-minifier's default, false.
You can also disable minification altogether by passing: