Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should the package distribution contain minified sources? #27

Closed
molefrog opened this issue Aug 25, 2020 · 4 comments · Fixed by #30
Closed

Should the package distribution contain minified sources? #27

molefrog opened this issue Aug 25, 2020 · 4 comments · Fixed by #30
Labels
optimization Make the library faster or lighter

Comments

@molefrog
Copy link
Collaborator

I was surprised to see that the unpacked size of the package is 443 kB. Turns out it has minified sources with source maps, that weight ~16kb each:

├── [ 79K]  dist
│   ├── [1015]  index.css
│   ├── [3.2K]  index.esmodule.js
│   ├── [ 16K]  index.esmodule.js.map
│   ├── [3.6K]  index.js
│   ├── [ 16K]  index.js.map
│   ├── [3.5K]  index.module.js
│   ├── [ 16K]  index.module.js.map
│   ├── [3.8K]  index.umd.js
│   └── [ 16K]  index.umd.js.map

I wonder if the distribution should contain minified sources at all. Thoughts?

@omgovich
Copy link
Owner

Hmmm. I guess we could remove them from the bundle to make package installation faster.
It's easy to do with microbundle (just need to add --sourcemap false to CLI command).

@molefrog
Copy link
Collaborator Author

@omgovich Right, should we also turn the minification off? It's a small detail, but could result in better DX: I often read sources straight from the node_modules folder.

@omgovich
Copy link
Owner

omgovich commented Aug 25, 2020

I would keep the minification enabled because I like to control the bundle size.
Microbundle/rollup converts my code a lot (and I love how) during the minification and I keep this rules in mind during the features development.
Some another bundler could do it another way.

@omgovich
Copy link
Owner

Going to update the bundler settings as soon as TS migration is done.

@omgovich omgovich added the optimization Make the library faster or lighter label Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Make the library faster or lighter
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants