Skip to content

Commit 0c244cb

Browse files
committedFeb 27, 2022
Upgrade to gulp 4
1 parent 5ef6d71 commit 0c244cb

File tree

3 files changed

+729
-607
lines changed

3 files changed

+729
-607
lines changed
 

Diff for: ‎gulpfile.js

+13-21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
const del = require("del");
1+
const { series, watch } = require('gulp');
22
const gulp = require("gulp");
3-
const gulpSequence = require("gulp-sequence");
43
const exec = require("child_process").exec;
54

65
const execCmd = (cmd, directory) => {
@@ -30,27 +29,20 @@ const conf = {
3029
}
3130
};
3231

33-
gulp.task("clean", function() {
34-
return del([conf.output.dir]);
35-
});
32+
async function prepareDemo(cb) {
33+
await execCmd("yarn", './src-demo')
34+
cb();
35+
}
3636

37-
gulp.task("build", function() {
38-
return execCmd("yarn build");
39-
});
37+
function copyToDemo() {
38+
return gulp.src(conf.copyFrom, { base: "." }).pipe(gulp.dest(conf.copyTo))
39+
}
4040

41-
gulp.task("prepare-demo", function() {
42-
return execCmd("yarn", './src-demo');
43-
});
44-
45-
gulp.task("copy-to-demo", function() {
46-
return gulp.src(conf.copyFrom, { base: "." }).pipe(gulp.dest(conf.copyTo));
47-
});
48-
49-
gulp.task("watch-and-copy-to-demo", function() {
50-
// Execute commands in series
41+
function watchAndCopy(cb) {
42+
// body omitted
5143
execCmd("yarn watch", '.');
52-
gulp.watch(conf.output.dir, ["copy-to-demo"]);
44+
watch(conf.output.dir, copyToDemo);
5345
execCmd("sleep 10 && yarn start", 'src-demo');
54-
});
46+
}
5547

56-
gulp.task("start-demo", gulpSequence("prepare-demo", "watch-and-copy-to-demo"));
48+
exports['start-demo'] = series(prepareDemo, watchAndCopy);

Diff for: ‎package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,9 @@
2222
"@types/react": "^16.8.13",
2323
"@types/react-router-dom": "^5.1.5",
2424
"@types/rx": "^4.1.1",
25-
"cpx": "^1.5.0",
26-
"del": "^3.0.0",
2725
"firebase": "^9.6.4",
2826
"firebase-tools": "^8.1.1",
29-
"gulp": "^3.9.1",
30-
"gulp-sequence": "^1.0.0",
27+
"gulp": "^4.0.2",
3128
"jest": "^23.6.0",
3229
"microbundle": "^0.12.4",
3330
"ra-core": "3.10.0",

Diff for: ‎yarn.lock

+715-582
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.