Reputation: 8683
I have a gulp task setup like so:
gulp.task('dev', ['lint', 'dev:js', 'dev:css', 'fonts', 'connect', 'watch', 'browser']);
I would like for the lint
task to be run before any of the other tasks, but they all run asynchronously.
I understand that the fn
argument for gulp.task
would only be run after the dependencies run, so that seems like the ideal place to run all of the other tasks after lint
, I'm just not sure how to do that with gulp.
Upvotes: 0
Views: 124
Reputation: 2857
You can use gulp-sequence or run-sequence module.
Here's a example of gulp-sequence
Source: https://www.npmjs.com/package/gulp-sequence
var gulpSequence = require('gulp-sequence');
gulp.task( 'dev', gulpSequence( 'lint', [ 'dev:js', 'dev:css', 'fonts', 'connect', 'watch', 'browser' ] ) );
It will run lint first, then all other async.
Upvotes: 1