Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: watching directories #558

Merged
merged 1 commit into from
Nov 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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