Create a .npmignore
Closed this issue · 1 comments
L1lith commented
It would be good to also include a .npmignore file so that you don't publish files that only exist in your dev environment and don't need to be published.
here are some things that shouldn't be published:
- your .babelrc
- prettier.config.js
- your logo probably as people likely won't open it from their node_modules fetc
- etc
Here's some documentation about it:
The npmignore file
Also note that you'll need to duplicate the contents of your .gitignore if you want those rules to be respected as the .npmignore will override your gitignore (only when publishing on npm, not in general).
Thanks for reading my issue, good luck on your project
nanxiaobei commented
Hi, this lib has files
key in package.json
, so only include necessary files.
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#files