Ensure Gulp tasks run sequentially

So that images are always copied into place before trying to build the
SASS.
This commit is contained in:
Chris Hill-Scott
2019-02-06 16:09:39 +00:00
parent 8f6c6e08e4
commit 06a9e56589
2 changed files with 20 additions and 14 deletions

View File

@@ -8,6 +8,7 @@
import gulp from 'gulp';
import loadPlugins from 'gulp-load-plugins';
import stylish from 'jshint-stylish';
import runSequence from 'run-sequence';
const plugins = loadPlugins(),
@@ -156,19 +157,23 @@ gulp.task('lint',
);
// Default: compile everything
gulp.task('default',
[
'copy:govuk_template:template',
'copy:govuk_template:images',
'copy:govuk_template:fonts',
'copy:govuk_template:css',
'copy:govuk_template:js',
'copy:govuk_template:error_page',
'images',
'javascripts',
'sass'
]
);
gulp.task('default', function() {
runSequence(
[
'copy:govuk_template:template',
'copy:govuk_template:images',
'copy:govuk_template:fonts',
'copy:govuk_template:css',
'copy:govuk_template:js',
'images',
],
[
'copy:govuk_template:error_page',
'javascripts',
'sass'
]
);
});
// Optional: recompile on changes
gulp.task('watch',

View File

@@ -44,6 +44,7 @@
"gulp-prettyerror": "1.2.1",
"gulp-sass-lint": "1.2.0",
"jshint": "2.9.5",
"jshint-stylish": "2.2.1"
"jshint-stylish": "2.2.1",
"run-sequence": "^2.2.1"
}
}