Я пытаюсь создать мой bundle.js
с помощью функции watchify, но, к сожалению, когда я сохраняю файлы, события обновления не срабатывают.Watchify не испускает событие обновления
var bundler = watchify(browserify({
debug: true,
entries: ['./js/main.js'],
transform: "babelify",
cache: {}, packageCache: {}, fullPaths: true
}))
.on("update", function() {
var updateStart = Date.now();
console.log(updateStart);
return bundler
.bundle()
.pipe(exorcist(path.join(distPath, "bundle.js.map")))
.pipe(fs.createWriteStream(path.join(distPath, "bundle.js")));
})
.bundle()
.pipe(exorcist(path.join(distPath, "bundle.js.map")))
.pipe(fs.createWriteStream(path.join(distPath, "bundle.js")));
Когда я использую CLI, поведение похоже: Build запускается после запуска, и все.
watchify ./js/main.js -o js-dist/bundle.js -v
Я использую OS X Yosemite.