Merge pull request #3698 from hayeah/master

Watch mode should wait for file write. (T7411)
This commit is contained in:
Logan Smyth 2017-01-15 14:44:45 -08:00 committed by GitHub
commit 40746f3dcb
2 changed files with 10 additions and 2 deletions

View File

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

View File

@ -151,7 +151,11 @@ module.exports = function (commander, filenames, opts) {
const 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;