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

swc-loader much slower if react refresh plugin is enabled #543

Closed
piotrpalek opened this issue Dec 16, 2021 · 6 comments
Closed

swc-loader much slower if react refresh plugin is enabled #543

piotrpalek opened this issue Dec 16, 2021 · 6 comments

Comments

@piotrpalek
Copy link

piotrpalek commented Dec 16, 2021

Hey, I've tried integrating react fast refresh with swc-loader, and the result is that if I add new ReactRefreshPlugin() to the plugins: [] list in webpack, swc-loader is dog slow (well, as slow as if I was using babel). If I remove this plugin it's way faster, any ideas what could be wrong? Is this expected?

@pmmmwh
Copy link
Owner

pmmmwh commented Dec 25, 2021

Hey, I've tried integrating react fast refresh with swc-loader, and the result is that if I add new ReactRefreshPlugin() to the plugins: [] list in webpack, swc-loader is dog slow (well, as slow as if I was using babel). If I remove this plugin it's way faster, any ideas what could be wrong? Is this expected?

Can you share a bit more about your setup, or create a reproducible example? There have been performance fixes in the 0.5.x releases, but we do inject another loader into the bundling chain so maybe that would slow things down.

@piotrpalek
Copy link
Author

piotrpalek commented Dec 26, 2021

Thanks for the info :)

Sorry if I'm light on details, but I'm still trying to come up with a reproducible example, and I can't share the whole repo since it's work related. I was asking to see if maybe this was known, could help me in research knowing where to look :)

I'll be hacking around and let you know if/when I manage to reproduce it or solve the issue

@pmmmwh
Copy link
Owner

pmmmwh commented Dec 26, 2021

Thanks for the info :)

Sorry if I'm light on details, but I'm still trying to come up with a reproducible example, and I can't share the whole repo since it's work related. I was asking to see if maybe this was known, could help me in research knowing where to look :)

I'll be hacking around and let you know if/when I manage to reproduce it or solve the issue

It could very much be due to source map generation, or if you have a lot of files that needs to be processed. Those are the two most likely points of clogging.

@marco2216
Copy link
Contributor

Hi @piotrpalek did you find any solution? We are experiencing the same issue on a large project

@piotrpalek
Copy link
Author

@marco2216 no sorry :( for now we just didn't move to swc-loader

@marco2216
Copy link
Contributor

@piotrpalek Feel free to try out if this change helps, I'm not actually sure if it has anything to do with swc-loader, but it significantly improved our transpile speed #669

@pmmmwh pmmmwh closed this as completed Nov 10, 2022
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

No branches or pull requests

3 participants