react-refresh-webpack-plugin
react-refresh-webpack-plugin copied to clipboard
swc-loader much slower if react refresh plugin is enabled
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?
Hey, I've tried integrating react fast refresh with
swc-loader, and the result is that if I addnew ReactRefreshPlugin()to theplugins: []list in webpack,swc-loaderis 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.
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
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.
Hi @piotrpalek did you find any solution? We are experiencing the same issue on a large project
@marco2216 no sorry :( for now we just didn't move to swc-loader
@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 https://github.com/pmmmwh/react-refresh-webpack-plugin/pull/669