chore(package): use `files` in `package.json` instead of `.npmignore`
GervinFung opened this issue · comments
Motivation
It’s better to explicitly mention what should be packaged instead of listing everything that should not be included, as it requires more effort and it's possible to forget to add a new file/folder to .npmignore
Expected behavior
It will publish the files/folders that were whitelisted in package.json
@GervinFung Thanks for this suggestion. Are there any files that shouldn't be in the package?
@GervinFung Thanks for this suggestion. Are there any files that shouldn't be in the package?
Hey, as of now I think it published what it should, except for .eslintrc.json
, but that is ok, it's not a big issue. Just that I think it would be much easier to whitelist files/folders with package.json
instead of blacklisting with .npmignore
of what should not be published as you have to tally it manually.
For instance, if you whitelist with package.json
, you only need to add bin
, dist
and astring.d.ts
to files
in package.json, it will automatically include what it needs like package.json
itself, README.md
and LICENSE
Right, .eslintrc.json
shouldn't be there.
If you are ok with it, I can create a PR that solve this issue by whitelisting what should be published instead