Reputation: 11383
What should I modify in my code to get these two tasks to build in sequence?
I have never had this problem before with gulp, but now that I want to run two tasks in sequence, it is not working properly. I have two tasks previously set up.
gulp.task('copyAllFiles', function() {
//PHP files
gulp.src('src/*.php')
.pipe(gulp.dest('dist'));
//childtheme screenshot
gulp.src('src/screenshot.png')
.pipe(gulp.dest('dist'));
});
gulp.task('sass2css', function() {
return gulp.src('src/sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('dist'))
});
I then added a "build" task to run both
gulp.task('build', function(callback) {
runSequence(['copyAllFiles', 'sass2css'], callback);
});
But now getting this error
ReferenceError: runSequence is not defined
Upvotes: 1
Views: 936
Reputation: 5456
To use runSequence
, you'll need to install that dependency and require
it into your gulp file:
Install
npm install --save-dev run-sequence
Gulp file
const runSequence = require('run-sequence');
Upvotes: 4