-
-
Notifications
You must be signed in to change notification settings - Fork 199
Display a warning when calling "copyFiles" with an invalid path #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lib/config-generator.js
Outdated
); | ||
|
||
if (!fs.existsSync(copyFrom) || !fs.lstatSync(copyFrom).isDirectory()) { | ||
logger.warning(`The "from" option of copyFiles() should be set to an existing directory but "${entry.from}" does not seem to be one. No file will be copied for this entry.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"entry" might not be the best word here... because it means something else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, maybe... by "entry" I meant "config entry", would it be better to put that?
lib/config-generator.js
Outdated
entry.from | ||
); | ||
|
||
if (!fs.existsSync(copyFrom) || !fs.lstatSync(copyFrom).isDirectory()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could break these into 2 separate pieces: 1 error is that the path doesn't exist. Another error is that they've pointed directly to a single file, not a directory, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…rectory or an invalid one
Thanks @Lyrkan! |
…ath (Lyrkan) This PR was squashed before being merged into the master branch (closes #456). Discussion ---------- Display a warning when calling "copyFiles" with an invalid path This PR adds a warning when `copyFiles()` is called with a `from` value that isn't an existing directory. This is kind of related to #445 but even if the friendly-errors-webpack-plugin worked properly in this case the origin of the error would probably not be obvious (it'd most likely contain a reference to the temporary entry). Commits ------- 5161d30 Display a different warning when trying to copy from an unexisting directory or an invalid one 8cb9d4a Display a warning when calling "copyFiles" with an invalid path
This PR adds a warning when
copyFiles()
is called with afrom
value that isn't an existing directory.This is kind of related to #445 but even if the friendly-errors-webpack-plugin worked properly in this case the origin of the error would probably not be obvious (it'd most likely contain a reference to the temporary entry).