Replace gulp.watch() with the gulp-watch package to detect/watch new files
This commit is contained in:
parent
601c31c949
commit
7919e6421d
|
@ -6,6 +6,7 @@ import postcss from "gulp-postcss";
|
||||||
import cssImport from "postcss-import";
|
import cssImport from "postcss-import";
|
||||||
import cssnext from "postcss-cssnext";
|
import cssnext from "postcss-cssnext";
|
||||||
import BrowserSync from "browser-sync";
|
import BrowserSync from "browser-sync";
|
||||||
|
import watch from "gulp-watch";
|
||||||
import webpack from "webpack";
|
import webpack from "webpack";
|
||||||
import webpackConfig from "./webpack.conf";
|
import webpackConfig from "./webpack.conf";
|
||||||
|
|
||||||
|
@ -53,9 +54,9 @@ gulp.task("server", ["hugo", "css", "js"], () => {
|
||||||
baseDir: "./dist"
|
baseDir: "./dist"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
gulp.watch("./src/js/**/*.js", ["js"]);
|
watch("./src/js/**/*.js", () => { gulp.start(["js"]) });
|
||||||
gulp.watch("./src/css/**/*.css", ["css"]);
|
watch("./src/css/**/*.css", () => { gulp.start(["css"]) });
|
||||||
gulp.watch("./site/**/*", ["hugo"]);
|
watch("./site/**/*", () => { gulp.start(["hugo"]) });
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
"gulp-babel": "^6.1.2",
|
"gulp-babel": "^6.1.2",
|
||||||
"gulp-postcss": "^6.1.1",
|
"gulp-postcss": "^6.1.1",
|
||||||
"gulp-util": "^3.0.7",
|
"gulp-util": "^3.0.7",
|
||||||
|
"gulp-watch": "^4.3.11",
|
||||||
"hugo-bin": "^0.12.0",
|
"hugo-bin": "^0.12.0",
|
||||||
"imports-loader": "^0.7.1",
|
"imports-loader": "^0.7.1",
|
||||||
"postcss-cssnext": "^2.7.0",
|
"postcss-cssnext": "^2.7.0",
|
||||||
|
|
Reference in New Issue