Skip to content
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

Improve clarity on how plugin works with built files #372

Closed
wants to merge 2 commits into from

Conversation

soundasleep
Copy link

It appears that copy-webpack-plugin is designed to copy files outside of the build process, rather than copy files created by the build process. See: #261

If one uses webpack-copy-plugin to try and copy a built file, if the file did not exist already, then the developer may receive a WARNING in unable to locate message, and the file is not correctly copied. This can cause some weird behaviour, especially because if you run webpack again, it will work fine (because it's copied over the previously built file).

I would like to suggest adding in this documentation to the README to prevent people from using the plugin when it's not appropriate for their needs.

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Breaking Changes

Additional Info

It appears that copy-webpack-plugin is designed to copy files _outside_ of the build process, rather than copy files _created by_ the build process. See: webpack-contrib#261

If one uses webpack-copy-plugin to try and copy a built file, if the file did not exist already, then the developer may receive a `WARNING in unable to locate` message, and the file is not correctly copied. This can cause some weird behaviour, especially because if you run webpack again, it will work fine (because it's copied over the previously built file).

I would like to suggest adding in this documentation to the README to prevent people from using the plugin when it's not appropriate for their needs.
@jsf-clabot
Copy link

jsf-clabot commented Apr 17, 2019

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

@alexander-akait
Copy link
Member

Can you create minimum reproducible test repo, looks like a bug

@soundasleep
Copy link
Author

soundasleep commented Apr 17, 2019

The minimum reproducible thing is:

  • a webpack that compiles e.g. index.js --> dist/index.js
  • configure copy-webpack-plugin to copy e.g. dist/index.js --> dist/index2.js

The first time you run webpack, dist/index.js doesn't exist, so I get a warning that the file doesn't exist. The second time, as long as you haven't cleaned out dist/, the (old) file is copied fine.

@alexander-akait
Copy link
Member

Sorry for delay, see what you mean, you let's merge this in docs

@alexander-akait
Copy link
Member

Close in #395, thanks for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants