-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
Plugin goes into a loop and build doesn't complete #345
Comments
Going back to |
@davestewart please create minimum reproducible test repo |
We don't modify hooks for |
OK, it's quite a big project, so let me find some time. |
@davestewart thanks! |
I'm seeing looping behavior which might be related.
The webpack-dev-server process repeatedly compiles. It's fully correlated with copy-webpack-plugin version 5.0.0. Reverting to 4.6.0 resolves the issue. So does removing the copy directives from the plugin in webpack.config.js. It's also largely correlated with a browser aimed at the server. I can't reproduce the problem by starting up the server on its own. I have to launch the page. And if I then close the browser, the looping eventually stops. Occasionally I can keep the browser up, and the looping will stop anyway, but that's a small minority of the time, and I can't reliably reproduce that. I get the feeling that loading the page causes something to seem 'dirty', so the server compiles. The compilation causes the page to reload, which causes a cycle. I stripped my own javascript behaviors, so that my app didn't do anything but show static html, but the looping continued. |
i suffer from the same behavior once i've updated to version 5. $ cat package.json | grep -i copy-webpack-plugin
"copy-webpack-plugin": "^5.0.0", trying to debug the issue, i noticed that when a wildcard is used for specifying which files to copy, the webpack build is going into infinite building\compiling loop. dropping the wildcard (instead, specifying each file individually), bypasses the issue. apologies for not posting a testing repository. |
Please create minimum reproducible test repo. Anyway problem can be when you use copy wetback plugin with glob (example |
@evilebottnawi: thank you for the reply. though, i am not sure i understand you.
when you say "this", to which directory exactly do you refer -- the input\source-code directory or the output\distribution directory? |
@y0y0z directory which you use in |
@evilebottnawi: from my inspection, nothing is changing in the |
@y0y0z any tools, i don't know you os/filesystem. You can try to create minimum reproducible test repo, maybe something wrong and i can catch problem |
If someone is still facing this problem maybe this can help. |
@vonBrax Right solution 👍 This change was introduced because it is impossible works properly with glob without adding |
Just for information, build system as |
Thank you @vonBrax for the instructions. That helped a lot. Before: new CopyWebpackPlugin(
[
{
from: 'node_modules/some-external-package/dist/**/*',
to: 'webWorkerSupport/',
},
{
context: 'src/',
from: 'someInternalDirectory/images/**/*',
to: '',
},
],
undefined
), After: new CopyWebpackPlugin(
[
{
context: 'node_modules/some-external-package/dist/',
from: '**/*',
to: 'webWorkerSupport/node_modules/some-external-package/dist/',
},
{
context: 'src/someInternalDirectory/images/',
from: '**/*',
to: 'someInternalDirectory/images/',
},
],
undefined
), |
Faced the same issue as well after the upgrade to |
@craigsumner you can avoid @hongkheng README.md might have to be updated with correct update instructions for v5 in case others face this issue after the upgrade. hm, before some people use invalid configuration, what we should update? |
Find a problem, WIP on this |
@evilebottnawi: thanks again! |
Please test https://github.com/webpack-contrib/copy-webpack-plugin/releases/tag/v5.0.1, feel free to feedback, thanks |
@evilebottnawi: |
Expected Behavior
The copy webpack plugin runs and then the watch stops until further activity
Actual Behavior
The build goes into a loop:
Code
This is a Vue CLI 3 build using Webpack Chain:
How Do We Reproduce?
Let me know if you need more info and I will look into this.
The text was updated successfully, but these errors were encountered: