-
Notifications
You must be signed in to change notification settings - Fork 841
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
Use package.json
files
entry instead of .npmignore
#5800
Conversation
"test-env", | ||
"eui.d.ts", | ||
"i18ntokens.json", | ||
"NOTICE.txt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep the main README as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks for reminding me. There are certain files that are included regardless of your config; README is one of them: https://docs.npmjs.com/cli/v7/configuring-npm/package-json#files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh! 💡 TIL!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for this excellent cleanup!
we will likely stop distributing webpack bundles
Excited for this! 🎉
Preview documentation changes for this PR: https://eui.elastic.co/pr_5800/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it!
Summary
🤔
#5799 ("remove
.ci
from the EUI package") got me exploring.npmingnore
which reminded me of #4769 ("what else can we ignore?"). Reading thenpm
docs highlighted that we can make an include list rather than an exclude list by using thepackage.json
files
entry.The result is a decrease of 8MB or ~11% of the distributed package.
Confirmed Kibana and CRA both continue to work as expected.
Addendum
Yes, 63MB is still massive, but considering that includes 4 different targeted builds, 2 webpack bundles (one of which is 12MB), and 4 ~500KB CSS files. The CSS files will shrink rapidly with the move to CSS-in-JS, and we will likely stop distributing webpack bundles. Regardless, an actual consumer only (lol) sees 7MB (unpacked) in use, and the eventual move to packages will help immensely.
### Checklist