Skip to content

Commit

Permalink
fix: watching directories (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Nov 19, 2020
1 parent 5215721 commit 7b58fd9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ class CopyPlugin {
force: pattern.force,
};

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

logger.debug(`added '${absoluteFilename}' as a file dependency`);
Expand Down
4 changes: 4 additions & 0 deletions test/__snapshots__/CopyPlugin.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ exports[`CopyPlugin logging should logging when "from" is a directory: logs 1`]
Object {
"logs": Array [
"added './fixtures/directory' as a context dependency",
"added './fixtures/directory/.dottedfile' as a file dependency",
"added './fixtures/directory/directoryfile.txt' as a file dependency",
"added './fixtures/directory/nested/deep-nested/deepnested.txt' as a file dependency",
"added './fixtures/directory/nested/nestedfile.txt' as a file dependency",
"begin globbing './fixtures/directory/**/*'...",
"determined './fixtures/directory' is a directory",
"determined that './fixtures/directory/.dottedfile' should write to '.dottedfile'",
Expand Down

0 comments on commit 7b58fd9

Please sign in to comment.