Skip to content

Commit 7b58fd9

Browse files
fix: watching directories (#558)
1 parent 5215721 commit 7b58fd9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ class CopyPlugin {
351351
force: pattern.force,
352352
};
353353

354-
// If this came from a glob, add it to the file dependencies
355-
if (pattern.fromType === "glob") {
354+
// If this came from a glob or dir, add it to the file dependencies
355+
if (pattern.fromType === "dir" || pattern.fromType === "glob") {
356356
compilation.fileDependencies.add(absoluteFilename);
357357

358358
logger.debug(`added '${absoluteFilename}' as a file dependency`);

test/__snapshots__/CopyPlugin.test.js.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ exports[`CopyPlugin logging should logging when "from" is a directory: logs 1`]
176176
Object {
177177
"logs": Array [
178178
"added './fixtures/directory' as a context dependency",
179+
"added './fixtures/directory/.dottedfile' as a file dependency",
180+
"added './fixtures/directory/directoryfile.txt' as a file dependency",
181+
"added './fixtures/directory/nested/deep-nested/deepnested.txt' as a file dependency",
182+
"added './fixtures/directory/nested/nestedfile.txt' as a file dependency",
179183
"begin globbing './fixtures/directory/**/*'...",
180184
"determined './fixtures/directory' is a directory",
181185
"determined that './fixtures/directory/.dottedfile' should write to '.dottedfile'",

0 commit comments

Comments
 (0)