2
This is my current Gulpfile and as I am using it a lot, I would like to create a GULP WATCH that performs the uglify whenever the files are changed.
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var pump = require('pump');
gulp.task('compress', function (cb) {
console.log("Compressing the Source");
pump([
gulp.src('source/*.js'),
uglify(),
gulp.dest('assets/js')
]
);
console.log("Source Compressed");
console.log("Compressing AngularJS");
pump([
gulp.src('bower_components/angular/angular.js'),
uglify(),
gulp.dest('assets/js')
]
);
console.log("Compressing AngularJS Animate");
pump([
gulp.src('bower_components/angular-animate/angular-animate.js'),
uglify(),
gulp.dest('assets/js')
],
cb
);
});
Tips to improve the process will also be welcome.
I can’t remember the Gulp schematics in my head, but try to create a new task with the watch(s) (ers), like:
gulp.task('watch', function() { gulp.watch('',['compress'])} )
anything complement, or I see the most correct way coming home.– Pliavi
I’ll give you some tests, but I’d appreciate it if you could add
– Thiago Santos
hm, I’ve never used Bower, but he doesn’t pull the right, minified files anymore? what you want from them is to just take them out of the Bower folder and play at
assets/js
right?– Pliavi