Closed frederikhors closed 4 years ago
Bump
It seems strange because of the Webpack Module System, which deals with UMD/AMD/CommonJS dependencies by itself.
Rollup is significantly more effective at tree-shaking than Webpack, and thus can remove dead code more effectively, meaning a smaller bundle size.
For usage questions, please come and chat to us
I'm comparing
github.com/sveltejs/template
andgithub.com/sveltejs/template-webpack
.I expected the final bundle to be the same with the same codebase.
What I did:
Cloned both template using
degit
Removed sourcemap for js files in
rollup.config.js
, line 12:sourcemap: false
Removed line 10 (
window.app = app;
) inmain.js
for webpack template (now the twomain.js
are equal in content)Updated all dependencies to:
sveltejs/template
(Rollup),package.json
:sveltejs/template-webpack
(Webpack),package.json
:Results:
What I'm scared:
With more packages and components the difference for final bundle in size is about
>15KB
(rollup is smaller).Why does webpack's weigh more?
This scares me.