Answer the question
In order to leave comments, you need to log in
Gulp - Can't run tasks sequentially. How to do it in Gulp 4?
My task: 1. Compile
SCSS to the build/ folder
2.
Copy the resulting css to the test folder .
By the gulp build command, build/style.css is created, but not copied to test
. If you run gulp copy:css separately, it is copied.
Task code:
gulp.task('build', gulp.series(
'clean',
'css',
'copy:css',
));
// gulp clean - очистка build
gulp.task('clean', (done) => {
del( config.dest.root );
done();
});
gulp.task('css', (done) => {
gulp.src( config.src.cssEntry )
.pipe(sass({outputStyle: 'expanded'} )
.pipe(concat('style.css'))
.pipe(gulp.dest( config.dest.css ) );
done();
});
gulp.task('copy:css', (done) => {
gulp.src('build/css/**/*.*').pipe(gulp.dest('test/css/'));
done();
});
gulp.task('copy:css', (done) => {
gulp.src('build/css/style.css').pipe(gulp.dest('test/css/'));
// gulp.src('build/**/*.css').pipe(gulp.dest('test/'));
done();
});
[09:42:34] Starting 'css'...
[09:42:34] Finished 'css' after 11 ms
[09:42:34] Starting 'copy-wp:css'...
tree
[09:42:34] Finished 'copy-wp:css' after 6.87 ms
[09:42:34] Finished 'default' after 33 ms
events.js:183
throw er; // Unhandled 'error' event
^
Error: File not found with singular glob: D:/!!!DB_TopTools/OpenServer/domains/debug-gulp-wp/wp-content/themes/build/css/style.css (if this was purposeful, use `allowEmpty` option)
at Glob.<anonymous> (D:\!!!DB_TopTools\OpenServer\domains\debug-gulp-wp\wp-content\themes\node_modules\gulp\node_modules\glob-stream\readable.js:84:17)
at Object.onceWrapper (events.js:315:30)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question