Answer the question
In order to leave comments, you need to log in
Why is the main.js file created every other time?
A piece of gulpfile.js :
gulp.task('project:js', function() {
gulp.src(path.src.js)
.pipe(uglify())
.pipe(concat('project.js'))
.pipe(gulp.dest(path.build.js));
});
gulp.task('vendor:js', function() {
var vendor = bower_files('**/*.js');
vendor.push(path.src.semantic_js);
gulp.src(vendor)
.pipe(uglify())
.pipe(concat('vendor.js'))
.pipe(gulp.dest(path.build.js));
});
gulp.task('build:js', ['vendor:js', 'project:js'], function(){
gulp.src(['static/build/js/vendor.js', 'static/build/js/project.js'])
.pipe(concat('main.js'))
.pipe(gulp.dest(path.build.js));
});
Answer the question
In order to leave comments, you need to log in
Try to add return in every job.
gulp.task('project:js', function() {
return gulp.src(path.src.js)
.pipe(uglify())
.pipe(concat('project.js'))
.pipe(gulp.dest(path.build.js));
});
gulp.task('vendor:js', function() {
var vendor = bower_files('**/*.js');
vendor.push(path.src.semantic_js);
return gulp.src(vendor)
.pipe(uglify())
.pipe(concat('vendor.js'))
.pipe(gulp.dest(path.build.js));
});
gulp.task('build:js', ['vendor:js', 'project:js'], function(){
return gulp.src(['static/build/js/vendor.js', 'static/build/js/project.js'])
.pipe(concat('main.js'))
.pipe(gulp.dest(path.build.js));
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question