Parcel v1 build hugely smaller size than Parcel v2 #9252
-
We have been using Parcel v1 for our React project until we decided to upgrade to v2 hoping for a better bundle size, but what happened was the opposite. Parcel v2 produces a larger css and js filesize. Detailed report shows that Parcel v2 produces a larger size for the main packages we use (Preact JS / bulma CSS), as well as the pure React component files. PARCEL V1 Parcel v1 package.json dependencies:
Parcel v1 build command:
Parcel v1 parcel build detailed report (Look at chartist.js, bulma.sass and React component Meter.preact.js): PARCEL V2 Parcel v2 package.json dependencies:
Parcel v2 build command:
Parcel v2 parcel build detailed report (Look at chartist.js, bulma.sass and React component Meter.preact.js): NOTES: Parcel v1 Meter.preact.js external imports:
Gzip: We use gzip after parcel bundling for extra compression. I noted that the Parcel v1 final output is 99 kB, vs an output of 107 kB for v2, which is somewhat close. Does this refer to anything? PurgeCSS: The big change is that purgecss was working flawlessly with Parcel V1 as a built-in plugin, but needed some setup and config for v2. Maybe I couldn't get that to work with v2 yet, but does this cause a bad compression for everything? Or is it a tree-shaking issue with Preact - for e.g.? I feel like there's a missing key that may solve everything. Any help would be much appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The detailed report in Parcel 2 is often not very accurate, especially with As far as I can tell, the Parcel 2 output is 238kb of JS vs Parcel 1's 300kb of JS. So actually Parcel 2 is better for JS? But worse for CSS somehow? |
Beta Was this translation helpful? Give feedback.
The detailed report in Parcel 2 is often not very accurate, especially with
--no-source-maps
, because it uses sourcemaps to determine where code in the output bundle came from.As far as I can tell, the Parcel 2 output is 238kb of JS vs Parcel 1's 300kb of JS. So actually Parcel 2 is better for JS? But worse for CSS somehow?