Skip to content

Commit

Permalink
Prevent Windows from watching root path on Windows due to case sensit…
Browse files Browse the repository at this point in the history
…ive matching. Fixes ef4#17
  • Loading branch information
johnnyshields committed Feb 7, 2015
1 parent 8433358 commit b8061e7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/caching-browserify.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,17 @@ module.exports = CoreObject.extend({
watchNodeModules: function(readTree) {
var self = this;
return mapSeries(Object.keys(self._watchModules), function(dir){
if (dir !== self.root){
if (self.normalizePath(dir) !== self.normalizePath(self.root)){
return readTree(dir);
}
});
},

// Changes path drive-letter to lowercase for Windows
normalizePath: function(path) {
return path.match(/^[a-z]:\\/i) ? path.charAt(0).toLowerCase() + path.slice(1) : path;
},

// Due to the way CJS dependencies work, the appearance of a new
// file in our input trees doesn't invalidate our cache -- because
// unless one of the existing files changes, nobody depends on the
Expand Down

0 comments on commit b8061e7

Please sign in to comment.