Large bundle size #3282
Replies: 2 comments 1 reply
-
This is definitely too big. Perhaps you are transpiling to ES5? If you go to the home page and check the network panel for Typical sizes for a single component are 15-20 KB (compressed, that is what matters for download) depending on component complexity. This includes the base element that all components extend (the framework part so too say), and every additional web component is adding 3-5 Kb on top (the actual component implementation. A real example I just did: I used vitejs to calculate these, here are the steps: $ npm init @vitejs/app switch-size --template vanilla
$ cd switch-size
$ npm install
$ npm install @ui5/webcomponents --save add a switch in main.js import '@ui5/webcomponents/dist/Switch.js';
document.querySelector('#app').innerHTML = `
<ui5-switch></ui5-switch>
` $ npm run build
...
dist/assets/vendor.a0d508d1.js 114.19kb / brotli: 23.86kb |
Beta Was this translation helpful? Give feedback.
-
I am also getting much bigger size. Only 5 components and 4 SVG icons, and I am getting |
Beta Was this translation helpful? Give feedback.
-
Hi, just getting started with ui5-webcomponents and considering it for an upcoming project. I have a question about bundle size - perhaps somebody can enlighten me.
If I pull in a simple switch component, the final bundle size (no compression, no sourcemaps) is 470kb. Is this sort of size to be expected? Am I overlooking something?
Webpack config (pretty standard):
Edit: typo
Beta Was this translation helpful? Give feedback.
All reactions