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

Minify db.json file #290

Open
dosisod opened this issue Apr 18, 2023 · 5 comments
Open

Minify db.json file #290

dosisod opened this issue Apr 18, 2023 · 5 comments

Comments

@dosisod
Copy link

dosisod commented Apr 18, 2023

By minifying the db.json file (stripping whitespace, newlines, etc) before uploading we could reduce the size of this package by about 40KB (uncompressed).

Size based on master:

$ npm pack
npm notice 185.9kB db.json
npm notice package size:  27.0 kB
npm notice unpacked size: 205.5 kB

Size with minified db.json file:

$ npm pack
npm notice 146.2kB db.json
npm notice package size:  26.5 kB
npm notice unpacked size: 165.8 kB

We could accomplish this by directly minifying the JSON output from npm run build, or by having a script to minify the file right before uploading to NPM.

I don't see any deploy scripts or anything, but I would be happy to write a pre-upload script of sorts to accomplish this if we decide it is worth it.

Thanks!

@dougwilson
Copy link
Contributor

Yes, I agree. I have a branch (but looking it seems to not be pushed yet) that actually does that and more, with that exact goal: make the package size as small as possible. It requires changes to even the release process, of course, since it will no longer match what it on the github, but it is in progress 👍

@dougwilson
Copy link
Contributor

Looking at my branch, it looks like I have an intermediate change I can actually push up that reduces the size by 70kb even.

@dougwilson
Copy link
Contributor

I will need to take a closer look at my changes tomorrow or so 👍 hopefully I can land them here soon.

@dosisod
Copy link
Author

dosisod commented Apr 18, 2023

Cool! I'm curious to see how you managed to get the size down by that much.

@dosisod
Copy link
Author

dosisod commented Sep 3, 2023

Hey @dougwilson any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants