Skip to content

Commit

Permalink
Merge pull request #5297 from webpack/bugfix/watch-missing-directories
Browse files Browse the repository at this point in the history
watch missing directories
  • Loading branch information
sokra committed Jul 15, 2017
2 parents 981fd23 + 329a805 commit a064968
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/node/NodeWatchFileSystem.js
Expand Up @@ -48,7 +48,7 @@ class NodeWatchFileSystem {
changes.filter(file => missing.indexOf(file) >= 0).sort(), times, times);
});

this.watcher.watch(files.concat(missing), dirs, startTime);
this.watcher.watch(files.concat(missing), dirs.concat(missing), startTime);

if(oldWatcher) {
oldWatcher.close();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -23,7 +23,7 @@
"supports-color": "^3.1.0",
"tapable": "~0.2.5",
"uglifyjs-webpack-plugin": "^0.4.6",
"watchpack": "^1.3.1",
"watchpack": "^1.4.0",
"webpack-sources": "^1.0.1",
"yargs": "^6.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions test/WatchTestCases.test.js
Expand Up @@ -129,8 +129,8 @@ describe("WatchTestCases", () => {
const jsonStats = stats.toJson({
errorDetails: true
});
if(checkArrayExpectation(testDirectory, jsonStats, "error", "Error", done)) return;
if(checkArrayExpectation(testDirectory, jsonStats, "warning", "Warning", done)) return;
if(checkArrayExpectation(path.join(testDirectory, run.name), jsonStats, "error", "Error", done)) return;
if(checkArrayExpectation(path.join(testDirectory, run.name), jsonStats, "warning", "Warning", done)) return;
let exportedTests = 0;

function _it(title, fn) {
Expand Down
3 changes: 3 additions & 0 deletions test/watchCases/recover-from-error/missing-module/0/errors.js
@@ -0,0 +1,3 @@
module.exports = [
[/Module not found/, /Can't resolve 'some-module' /]
];
12 changes: 12 additions & 0 deletions test/watchCases/recover-from-error/missing-module/0/index.js
@@ -0,0 +1,12 @@
it("should recover from missing module", function() {
switch(WATCH_STEP) {
case "0":
(function() {
require("some-module");
}).should.throw();
break;
case "1":
require("some-module").should.be.eql("ok");
break;
}
});
Empty file.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions yarn.lock
Expand Up @@ -508,7 +508,7 @@ character-parser@1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/character-parser/-/character-parser-1.2.1.tgz#c0dde4ab182713b919b970959a123ecc1a30fcd6"

chokidar@^1.4.3:
chokidar@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468"
dependencies:
Expand Down Expand Up @@ -2088,6 +2088,7 @@ jade@^1.11.0:
jstransformer "0.0.2"
mkdirp "~0.5.0"
transformers "2.1.0"
uglify-js "^2.4.19"
void-elements "~2.0.1"
with "~4.0.0"

Expand Down Expand Up @@ -4184,12 +4185,12 @@ void-elements@~2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec"

watchpack@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.3.1.tgz#7d8693907b28ce6013e7f3610aa2a1acf07dad87"
watchpack@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.4.0.tgz#4a1472bcbb952bd0a9bb4036801f954dfb39faac"
dependencies:
async "^2.1.2"
chokidar "^1.4.3"
chokidar "^1.7.0"
graceful-fs "^4.1.2"

webpack-dev-middleware@^1.9.0:
Expand Down

0 comments on commit a064968

Please sign in to comment.