mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-04 18:53:26 +08:00
sped up local develpment workflow
only needed tasks will be ran on file save - lint js on js and browserify on save - lint json and static copy on static file save - sass compile on sass save
This commit is contained in:
parent
2f3de1fa1e
commit
864ef13a2a
1 changed files with 20 additions and 5 deletions
25
gulpfile.js
25
gulpfile.js
|
@ -20,9 +20,15 @@ task("clean", function () {
|
|||
return src(["./public/"], { allowEmpty: true }).pipe(vinylPaths(del));
|
||||
});
|
||||
|
||||
task("lint", function () {
|
||||
let filelist = ["./src/js/**/*.js", "./static/**/*.json"];
|
||||
return src(filelist)
|
||||
task("lint-js", function () {
|
||||
return src("./src/js/**/*.js")
|
||||
.pipe(eslint(eslintConfig))
|
||||
.pipe(eslint.format())
|
||||
.pipe(eslint.failAfterError());
|
||||
});
|
||||
|
||||
task("lint-json", function () {
|
||||
return src("./static/**/*.json")
|
||||
.pipe(eslint(eslintConfig))
|
||||
.pipe(eslint.format())
|
||||
.pipe(eslint.failAfterError());
|
||||
|
@ -98,11 +104,20 @@ task("updateSwCacheName", function () {
|
|||
|
||||
task(
|
||||
"compile",
|
||||
series("lint", "browserify", "static", "sass", "updateSwCacheName")
|
||||
series(
|
||||
"lint-js",
|
||||
"lint-json",
|
||||
"browserify",
|
||||
"static",
|
||||
"sass",
|
||||
"updateSwCacheName"
|
||||
)
|
||||
);
|
||||
|
||||
task("watch", function () {
|
||||
watch(["./static/**/*", "./src/**/*", "gulpfile.js"], series("compile"));
|
||||
watch("./src/sass/**/*.scss", series("sass"));
|
||||
watch("./src/js/**/*.js", series("lint-js", "browserify"));
|
||||
watch("./static/**/*.*", series("lint-json", "static"));
|
||||
});
|
||||
|
||||
task("build", series("clean", "compile"));
|
||||
|
|
Loading…
Reference in a new issue