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

package.json: Add "files" attribute for npm #18

Closed
wants to merge 1 commit into from

Conversation

mingchen
Copy link

Add "files" attributes for npm to only pack necessary files.
This is can reduce package size a lot under node_modules.

see https://docs.npmjs.com/misc/developers

Add "files" attributes for npm to only pack necessary files.
This is can reduce package size a lot under `node_modules`.

see https://docs.npmjs.com/misc/developers
@mscdex
Copy link
Owner

mscdex commented Jan 17, 2019

What is your definition of "a lot" ? There should not be any large files in the repo/package...

@mingchen
Copy link
Author

$ du -sh node_modules/dicer/*
4.0K	node_modules/dicer/LICENSE
4.0K	node_modules/dicer/README.md
 32K	node_modules/dicer/bench
 16K	node_modules/dicer/lib
4.0K	node_modules/dicer/package.json
180K	node_modules/dicer/test

will become to

$ du -sh node_modules/dicer/*
4.0K	node_modules/dicer/LICENSE
4.0K	node_modules/dicer/README.md
 16K	node_modules/dicer/lib
4.0K	node_modules/dicer/package.json

With this change, the test and bench will not in release. This reduce package size from 240K to 28k (about 88%). If all the dependences can do this, it will reduce node_modules a lot, it also save time on npm install.

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

Successfully merging this pull request may close these issues.

2 participants