-
-
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
In 6.x files are transformed/copied multiple times per build #505
Comments
This seems to be the likely cause: Switching from tapping into |
No, Changing hook was written in CHANGELOG, without it, the plugin does not work correctly |
In webpack@5, using |
Please checkout this repo: https://github.com/brendon/broken-copy run I'd instinctively expect What would be the way forward on this one? |
Because each compilation requires all assets What is a problem? You may need an asset inside |
Ok, turning on caching fixed the problem in this test repo, but I didn't experience the same result in my actual application. I returned a promise from I tried to simulate a delay with a
I must have been doing something wrong. I'll revisit this in my own code now that I understand how it works a bit more deeply. Thank you for your time :) |
Oh, my mistake, I think it is a problem, anyway cache is good idea here too |
Definitely. I'll have another go with 6.x now to see if the problem persists. What do you think the problem is? :) |
I've had another go and it doesn't wait for the promises to resolve before checking the cache for the next iteration. I could be misunderstanding the method I'm using as I don't understand TypeScript in this scenario: https://github.com/tinify/tinify-nodejs/blob/master/src/tinify/Result.ts#L37 But I assume it means that it'll return a promise because that's in the method definition and also |
@brendon yes, it is return promise |
Thanks @evilebottnawi, very much appreciated! :) |
Prior versions of copy-webpack-plugin 6.x contained a memory usage regression that could cause gigabytes of memory to be used during a build. Version 6.0.3 contains a fix that prevents this issue. Referenced Issue: webpack-contrib/copy-webpack-plugin#505
Prior versions of copy-webpack-plugin 6.x contained a memory usage regression that could cause gigabytes of memory to be used during a build. Version 6.0.3 contains a fix that prevents this issue. Referenced Issue: webpack-contrib/copy-webpack-plugin#505 (cherry picked from commit 23ae457)
Prior versions of copy-webpack-plugin 6.x contained a memory usage regression that could cause gigabytes of memory to be used during a build. Version 6.0.3 contains a fix that prevents this issue. Referenced Issue: webpack-contrib/copy-webpack-plugin#505 (cherry picked from commit 23ae457)
Prior versions of copy-webpack-plugin 6.x contained a memory usage regression that could cause gigabytes of memory to be used during a build. Version 6.0.3 contains a fix that prevents this issue. Referenced Issue: webpack-contrib/copy-webpack-plugin#505
Prior versions of copy-webpack-plugin 6.x contained a memory usage regression that could cause gigabytes of memory to be used during a build. Version 6.0.3 contains a fix that prevents this issue. Referenced Issue: webpack-contrib/copy-webpack-plugin#505 (cherry picked from commit 78064a8)
Prior versions of copy-webpack-plugin 6.x contained a memory usage regression that could cause gigabytes of memory to be used during a build. Version 6.0.3 contains a fix that prevents this issue. Referenced Issue: webpack-contrib/copy-webpack-plugin#505 (cherry picked from commit 78064a8)
Prior versions of copy-webpack-plugin 6.x contained a memory usage regression that could cause gigabytes of memory to be used during a build. Version 6.0.3 contains a fix that prevents this issue. Referenced Issue: webpack-contrib/copy-webpack-plugin#505
Prior versions of copy-webpack-plugin 6.x contained a memory usage regression that could cause gigabytes of memory to be used during a build. Version 6.0.3 contains a fix that prevents this issue. Referenced Issue: webpack-contrib/copy-webpack-plugin#505 8.3.x variant of #18088
Expected Behavior
Files should be transformed/copied only once per build
Actual Behavior
In 5.x the files are transformed once per build (verified by logging when
transform
is called). In 6.x thetransform
function is called a large number of times (perhaps 6-10 times per file.I noticed that removing
new VueLoaderPlugin()
from the plugins list reduced the multiple calls down to two per file. My suspicion is that in 6.x you're hooking into an event that runs even on child builds rather than on the entry point build.new VueLoaderPlugin()
seems to kick off a lot of child builds depending on the number of Vue components in the application.Reverting to 5.x fixed the issue.
Code
How Do We Reproduce?
The only hint I have is to do with
new VueLoaderPlugin()
. Hopefully this is enough of a pointer, but if not, let me know and I'll look into creating a minimal reproducible.The text was updated successfully, but these errors were encountered: