[Q/A] react-icon bloating Bundle Size #579
Replies: 2 comments 9 replies
-
So 2 issues:
|
Beta Was this translation helpful? Give feedback.
-
I've inspected your prod build - it's largely SVG, no source-map bundled. Note that prod build use esbuild, but afaik react-icons suffer that bundle problem since forever and it has not been fixed. I'd check your bundle because ESBuild can only detect and dedupe ESM bundle, but with CJS package like react-icons, it suffer from the age-old problem of CJS barrel file Furthermore - the small build with source-map does not work because it hoisted and stripped all of the icons dependency - likely a weird hoisting artifact but basically there's no svg in your smaller bundle. |
Beta Was this translation helpful? Give feedback.
-
What happened?
Running
plasmo build --minify
producesRunning
plasmo build --minify --source-maps
producesAlso this command runs extremely slow compared to the first one - 10s vs 200s (logs below). The step which takes up all the time is
🟡 0 | @plasmohq/parcel-packager
, the last one.Docs state that building for prod doesn't produce source maps by default but apparently it does - however I don't see any sourcemaps in the first produced bundle. But I will be honest I'm not nearly skilled enough to dig through both minified files to determine where does the bloat come from. I think I've tried rebuilding with vanilla tsconfig & package.json from
create plasmo
and results were the same but perhaps I've missed something.The repo is here
Version
Latest
What OS are you seeing the problem on?
Windows
What browsers are you seeing the problem on?
No response
Relevant log output
(OPTIONAL) Contact Details
ckuka71@gmail.com
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions