terinjokes/gulp-uglify

uglify do not minify all files

AlexyOd opened this issue · 2 comments

i have some files in folder jsfolder: 'src/js/jsadd/*.js',
but uglify do not minify them all

gulp.task('js:prebuild', function () {
gulp.src(path.src.js)
.pipe(rigger())
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(sourcemaps.write())
.pipe(gulp.dest(path.prebuild.js))
.pipe(reload({stream: true}));
gulp.src(path.src.jsfolder)
.pipe(rigger())
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(sourcemaps.write())
.pipe(gulp.dest(path.prebuild.js))
.pipe(reload({stream: true}));

});

var path = {
prebuild: {
html: 'prebuild/',
js: 'prebuild/js/',
css: 'prebuild/css/',
img: 'prebuild/img/',
fonts: 'prebuild/font/',
lib:'prebuild/lib/',

},	
src: {
	html: 'src/*.html',
	js: 'src/js/custom.js',
	jsfolder: 'src/js/jsadd/*.js',
	style: 'src/style/style.less',
	img: 'src/img/**/*.*',
	fonts: 'src/font/**/*.*',
	lib:'src/lib/**/*.*',
	
},
watch: {
	html: 'src/**/*.html',
	js: 'src/js/**/*.js',
	style: 'src/style/**/*.less',
	img: 'src/img/**/*.*',
	fonts: 'src/font/**/*.*'
},
clean: './build'

};

Your task is supposed to return a stream (which is created by gulp.src), which you aren't doing. You probably want to have multiple tasks and setting up dependencies.