Skip to content

Commit 4171d11

Browse files
committed
fix: fix task exec order
fix task exec order
1 parent 3b4fed4 commit 4171d11

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

gulpfile.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { src, dest, parallel, series, task } = require('gulp');
1+
const { src, dest, parallel, series } = require('gulp');
22
const fs = require('fs');
33
const through = require('through2');
44
const sass = require('gulp-sass');
@@ -52,19 +52,20 @@ function traverseExistStyleFile(isDelete) {
5252
existStyleCatalogName.push(file.relative.split('/')[0]);
5353
}
5454
callback();
55-
})).on('end', function () {
55+
})).on('end', async function () {
5656
const noStyleComp = difference(unique(componentCatalogName), unique(existStyleCatalogName));
5757
if (isDelete) {
5858
delStyleFile(noStyleComp)
5959
console.log('delStyleFile exec end')
6060
} else {
61-
writeStyleFile(noStyleComp)
61+
await writeStyleFile(noStyleComp)
62+
await outputStyleTask()
6263
console.log('writeStyleFile exec end')
6364
}
6465
})
6566
}
6667
function traverseComponent() {
67-
console.warn('Do not edit or modify the source file when the project is compiled !!!')
68+
console.warn('Do not edit the source file when the project is compiled !!!')
6869
return src(['src/components/*/', '!src/components/utils/']) // exclude utils/
6970
.pipe(through.obj(function (file, enc, callback) {
7071
componentCatalogName.push(file.relative.split('/')[0]);
@@ -148,4 +149,4 @@ function jsForCss(data) {
148149
.pipe(babel())
149150
.pipe(dest('lib/' + String(data) + '/style/'));
150151
}
151-
exports.default = series(clean, generateStyleFile, parallel(outputStyleTask, globalSass), globalCss, cleanUselessStyleFile);
152+
exports.default = series(clean, generateStyleFile, parallel(globalSass), globalCss, cleanUselessStyleFile);

0 commit comments

Comments
 (0)