Watch mode should wait for file change. (T7411)

This commit is contained in:
Howard Yeh 2016-09-03 16:32:39 +08:00
parent 8f790ceeed
commit 32232dd30e
2 changed files with 10 additions and 2 deletions

View File

@ -71,7 +71,11 @@ module.exports = function (commander, filenames) {
_.each(filenames, function (dirname) {
let watcher = chokidar.watch(dirname, {
persistent: true,
ignoreInitial: true
ignoreInitial: true,
awaitWriteFinish: {
stabilityThreshold: 50,
pollInterval: 10,
}
});
_.each(["add", "change"], function (type) {

View File

@ -138,7 +138,11 @@ module.exports = function (commander, filenames, opts) {
let chokidar = util.requireChokidar();
chokidar.watch(filenames, {
persistent: true,
ignoreInitial: true
ignoreInitial: true,
awaitWriteFinish: {
stabilityThreshold: 50,
pollInterval: 10,
}
}).on("all", function (type, filename) {
if (util.shouldIgnore(filename) || !util.canCompile(filename, commander.extensions)) return;