Comparing version 0.8.1 to 0.8.2
26
index.js
@@ -37,2 +37,6 @@ var through = require('through'); | ||
}); | ||
b.on('file', function (file) { | ||
watchFile(file); | ||
}); | ||
@@ -43,9 +47,4 @@ var fwatchers = {}; | ||
bundle.on('transform', function (tr, mfile) { | ||
if (!fwatchers[mfile]) fwatchers[mfile] = []; | ||
if (!fwatcherFiles[mfile]) fwatcherFiles[mfile] = []; | ||
watchFile(mfile, mfile); | ||
tr.on('file', function (file) { | ||
watchFile(mfile, file); | ||
watchDepFile(mfile, file); | ||
}); | ||
@@ -55,3 +54,16 @@ }); | ||
function watchFile(mfile, file) { | ||
function watchFile (file) { | ||
if (fwatchers[file]) return; | ||
if (!fwatchers[file]) fwatchers[file] = []; | ||
if (!fwatcherFiles[file]) fwatcherFiles[file] = []; | ||
var w = chokidar.watch(file, {persistent: true}); | ||
w.on('error', b.emit.bind(b, 'error')); | ||
w.on('change', function () { | ||
invalidate(file); | ||
}); | ||
fwatchers[file].push(w); | ||
} | ||
function watchDepFile(mfile, file) { | ||
if (!fwatchers[mfile]) return; | ||
@@ -58,0 +70,0 @@ if (fwatcherFiles[mfile].indexOf(file) >= 0) return; |
{ | ||
"name": "watchify", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "watch mode for browserify builds", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23108
17
598
11
5