-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
42 lines (32 loc) · 1.17 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const del = require("del");
const execa = require("execa");
const gulp = require("gulp");
const run = require("gulp-run");
const babel = require("gulp-babel");
gulp.task("clean", () => del(["dist"]));
gulp.task("static", () =>
gulp.src(["./src/static/**/*"]).pipe(gulp.dest("dist/static")),
);
gulp.task("noncode", () =>
gulp
// .src(["src/**/*.json", "src/**/*.markdown", ".babelrc", "next.config.js"])
.src(["src/**/*.json", "src/**/*.markdown", ".babelrc"])
.pipe(gulp.dest("dist")),
);
gulp.task("code", () =>
gulp
.src(["src/*.js", "src/**/*.js", "src/**/**/*.js", "src/**/**/**/*.js"])
.pipe(babel())
.pipe(gulp.dest("dist")),
);
gulp.task("next:build", () => run("npm run next:dist").exec());
gulp.task("next:export", () => run("npm run next:export").exec());
// gulp.task("next:copy-service-worker", () =>
// gulp.src(["dist/.next/service-worker.js"]).pipe(gulp.dest("dist"))
// );
// gulp.task("next", gulp.series(["next:build", "next:copy-service-worker"]));
// gulp.task("next", gulp.series(["next:build"]));
gulp.task(
"build",
gulp.series([gulp.parallel(["noncode", "static", "code"]), "next:build"]),
);