-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
include only necessary files in npm package #2818
Conversation
Plugins use some of the test folder files.. |
|
So, we should publish only |
Yes.. see the line and comment in the deleted npmignore.
|
only |
Yes I think that should be ok. Someone should test the core plugins before
merging this.
|
All files are necessary - as I explained in tape-testing/tape#260. Please don't exclude files for what is |
3 MB of test fixtures are not necessary for using this package. NPM package is not a clone of your repo. |
Using a whitelist in package.json is very dangerous - it makes it very easy to accidentally create or rename a file in your package, and forget to add it to the whitelist. If you want to blacklist test fixtures, great - do that with npmignore. That's a special case. |
Given the pr author is including whole folders and given less' folder structure, i dont think we should suffer this problem. |
or you can accidentally rename a file and forget to change |
If you do that, your tests will fail, because |
|
why that's a special case? all tests without their fixtures are broken. |
Sure, you'd need to then edit your tests so that they skip the tests requiring fixtures, when fixtures aren't available. It's a tradeoff of that added complexity versus the size of the fixtures. |
To be honest I can't see any reason to include just |
Loading unnecessary files is one of the reasons
npm install
s take so darn long. Anton Rudeshko very well put it in his article:Corey Butler also wrote a nice article about why it's important to minimize module footprints, including test suite:
Also see NPM docs for details about
files
field inpackage.json
.