gulp-angular-tpl2js
v1.0.0
Published
Use gulp to convert Angular templates to inline JavaScript
Downloads
1
Readme
gulp-angular-tpl2js
Inject AngularJS directive templates as inline JavaScript using gulp
Regarding Issues
This is just a simple gulp plugin, which means it's nothing more than a thin wrapper around angular-tpl2js. If it looks like you are having issues, please open an issue at angular-tpl2js. Only create a new issue if it looks like you're having a problem with the plugin itself.
Install
npm install gulp-angular-tpl2js --save-dev
API
tpl2js([config])
var gulp = require('gulp');
var tpl2js = require('gulp-angular-tpl2js');
gulp.task('inline', function() {
return gulp.src('/js/directives/*.js')
.pipe(tpl2js())
.pipe(gulp.dest('/dest'));
});
config
include
for retrieving ng-include templates and HTMLMinifier
, a relay for html-minifier options
// defaults
var config = {
include: false,
HTMLMinifier: {
collapseWhitespace: true,
removeComments: true
}
}
var gulp = require('gulp');
var tpl2js = require('gulp-angular-tpl2js');
gulp.task('inline', function() {
return gulp.src('/js/directives/*.js')
.pipe(tpl2js({include: true})) // ng-include parsed
.pipe(gulp.dest('/dest'));
});