With barrels: 5 modules, 4.39 kB Without barrels: 3 modules, 3.56 kB
With barrels: 448 bytes Without barrels: 334 bytes
Note on size:
- the generated output is smaller in both cases
- webpack has a small overhead independent of the size of the application.
- in general rollup generates a more compact output
src/with-barrels
: example code using barrel filessrc/without-barrels
: example code without barrel filesoutput
: generated bundlesrollup-with-barrels.config
: rollup config for barrels examplerollup-without-barrels.config
: rollup config for without barrels examplewebpack.config.js
: webpack config for both examples
npm i
npm run build