I'm using generator-gulp-webapp, but I want to just selected Javascript files that build in minified form. How can I edit gulpfile.js
? Here is the html
task. I think I should edit this task.
gulp.task('html', ['views','styles'], function () {
var assets = $.useref.assets({searchPath: ['.tmp', 'app', '.']});
return gulp.src(['app/*.html', '.tmp/*.html'])
.pipe(assets)
.pipe($.if('*.js', $.uglify()))
.pipe($.if('*.css', $.csso()))
.pipe(assets.restore())
.pipe($.useref())
.pipe(gulp.dest('dist'));
});
if you only want to uglify js files here is a simple task :