[BUG] npm package contains extra files
Describe the bug
When looking at the code in npmjs.org (https://www.npmjs.com/package/danger?activeTab=code), you can see that there are a lot extra files that do not need to be included to the package. The size of danger is already big, so it would be nice to reduce the install size even a little bit.
Paths that could be added to .npmignore
.github.eslintignore.eslintrc.json.gitattributes.pre-commit-config.yaml.prettierignore.release-it.jsonCHANGELOG.mdCONTRIBUTING.mdDockerfileVISION.mdtsconfig.spec.json
Total would be around 90 kB saved. It's not that much of the total size of 1.43 MB, but at least something.
Seems reasonable to me
instead of npmignore I suggest files in package.json instead. npmignore is known for causing issues
I suggest creating .npmignore with whitelisting mode:
*
!/dist/**/*
!/package.json
!/CHANGELOG.md
!/README.md
The logic is:
- Exclude everything
- Use
!to specify what files to include.
But worth testing it over, I know it works with yarn 1.x, npm different versions may differ.
But for now, I just took the list and inserted it (easier)
- https://github.com/danger/danger-js/pull/1499
Merged: https://github.com/danger/danger-js/pull/1499