-
| I am using this setup: My rollup config: However, the bundle is quite big compared to CodeJar (61kb vs 20kb): One thing I noticed right away is that it's bundling all the themes even though I'm only using one theme. Is there something I can do in my JS setup or rollup config to decrease the bundle size? UPDATE: After commenting out all the themes I don't need, the bundle size is what I expect now :-) themes/index.js |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
| Nice to see that you found a solution. All the themes being included in the bundle as separate files is intended. Only the themes you need will get dynamically imported when you create an editor. So while the total bundle might've been 60kB, less than 30kB of it would've been loaded in the browser, making it a non-issue. Your solution did make the main JS chunk slightly smaller though since it removed most entries in the import map for the themes. If you wan't full control over your bundle, look at advanced usage. The example given there creates an editor equivalent to the full setup, but also with Also, since the package contains a lot of ES2020 syntax, you can decrease your bundle slightly by changing |
Beta Was this translation helpful? Give feedback.


Nice to see that you found a solution. All the themes being included in the bundle as separate files is intended. Only the themes you need will get dynamically imported when you create an editor. So while the total bundle might've been 60kB, less than 30kB of it would've been loaded in the browser, making it a non-issue.
Your solution did make the main JS chunk slightly smaller though since it removed most entries in the import map for the themes.
If you wan't full control over your bundle, look at advanced usage. The example given there creates an editor equivalent to the full setup, but also with
copyButton().Also, since the package contains a lot of ES2020 syntax, you can decrease you…