diff --git a/bin/6to5/file.js b/bin/6to5/file.js index 73c0f19a7f..a118389437 100644 --- a/bin/6to5/file.js +++ b/bin/6to5/file.js @@ -116,13 +116,11 @@ module.exports = function (commander, filenames) { var watcher = chokidar.watch(filenames, { persistent: true, ignoreInitial: true - }); - - _.each(["add", "change", "unlink"], function (type) { - watcher.on(type, function (filename) { + }).on("all", function (type, filename) { + if (type === "add" || type === "change" || type === "unlink" ) { console.log(type, filename); walk(); - }); + } }); } };