Closed RubenNL closed 5 months ago
Thanks. I did it slightly differently in 453bce6.
@domoritz I see you changed all of them to the dist
folder, except the module
one. Is this a mistake, or is there a reason for this that I can't find?
My project seems to the module export, so v0.81.0 doesn't reduce the project size for me compared to v0.79.0 :(
The module export is for bundlers and the bundler can do its own minimization. It's standard practice I think not to use the minified version for bundlers. Are you running your own minifier?
I'm using vite, and I think I found the issue. My project is in the middle of a migration to ESM. It seems like "something" is parsing this library as CommonJS, but importing it as ESM. When I manually force the file to be parsed as ESM, it minifies the file correctly.
Thanks for your time, and sorry to bother you :)
EDIT: it was actually using the correct file, but the tool I used to analyze my bunde (vite-bundle-visualizer, built on rollup-bundle-visualizer), reports the size wrong.
This reduces the bundle size by 60%, 30.85kb to 12.37kb.