Replace templateUrl by minified html template
npm install gulp-directive-replace
var gulp = require('gulp');
var directiveReplace = require('gulp-directive-replace');
gulp.task('directives', function(){
return gulp.src('./app/directives/*.js')
.pipe(directiveReplace())
.pipe(gulp.dest('./'));
});
The path between directive templateUrl string, and gulpfile path.
Example:
Let's say you have a following folder structure
/gulpfile.js
/app
index.html
/directives
yourdirective.js
/partials
yourpartial.html
Then, your directive templateUrl is: '/partials/yourpartial.html'
The plugin will get template url and needs find that there is a app folder, but will not. You need inform to it by "root" option, like this:
directiveReplace({root: 'app'})
Html minifier options.
This options is passed directly to Minimize.