Comparing version 0.3.0 to 0.4.0
35
index.js
@@ -18,11 +18,23 @@ var through = require('through'); | ||
var changingDeps = {}; | ||
var first = true; | ||
if (opts.cache) { | ||
cache = opts.cache; | ||
delete opts.cache; | ||
first = false; | ||
} | ||
if (opts.pkgcache) { | ||
pkgcache = opts.pkgcache; | ||
delete opts.pkgcache; | ||
} | ||
b.on('package', function (file, pkg) { | ||
pkgcache[file] = pkg; | ||
}); | ||
b.on('dep', function(dep) { | ||
queuedDeps[dep.id] = dep; | ||
}); | ||
function addDep (dep) { | ||
@@ -32,3 +44,3 @@ if (watching[dep.id]) return; | ||
cache[dep.id] = dep; | ||
var watcher = chokidar.watch(dep.id, { | ||
@@ -45,3 +57,3 @@ persistent: true, | ||
changingDeps[dep.id] = true | ||
// wait for the disk/editor to quiet down first: | ||
@@ -53,13 +65,11 @@ if (!pending) setTimeout(function () { | ||
}, opts.delay || 300); | ||
pending = true; | ||
}); | ||
} | ||
var bundle = b.bundle.bind(b); | ||
var first = true; | ||
b.bundle = function (opts_, cb) { | ||
if (b._pending) return bundle(opts_, cb); | ||
if (typeof opts_ === 'function') { | ||
@@ -74,3 +84,3 @@ cb = opts_; | ||
first = false; | ||
// we only want to mess with the listeners if the bundle was created | ||
@@ -93,5 +103,4 @@ // successfully, e.g. on the 'close' event. | ||
}; | ||
return b; | ||
} |
{ | ||
"name": "watchify", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"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
8825
135