untitledui-js
untitledui-js copied to clipboard
ESM Support and Tree-Shaking
When bundling this package with an app, tree-shaking is not occurring causing the index file to be inflated due to the import being commonJS, what should be happening is that only the icons that I want to use will be bundled without importing the entire icon set.
Reproduce
- Create a simple project, I used Vite
- Install package
npm i -D untitledui-js-base - Place 1 icon anywhere in
App.tsx - Run
npm run build
Notice how the index file is quite large.
vite v5.2.11 building for production...
✓ 35 modules transformed.
dist/index.html 0.46 kB │ gzip: 0.30 kB
dist/assets/react-CHdo91hT.svg 4.13 kB │ gzip: 2.05 kB
dist/assets/index-DiwrgTda.css 1.39 kB │ gzip: 0.72 kB
dist/assets/index-B8foZgZW.js 912.34 kB │ gzip: 213.54 kB
(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 1.02s
Thank you @alexbot89 for pointing this out, this issue would be address in a few days
This issue is being address on the main library the new changes would be applied to the base library in a few hours, once again @alexbot89 thank you for pointing this out