Closed DrewML closed 7 years ago
Would it not make more sense to go with an explicit files entry in package.json so as to not publish dotfiles etc.
I wouldn't say it "makes more sense"; rather, it's just another option. Each has there trade-offs:
npmignore
: You can accidentally publish more files than you planned tofiles
: You can forget to publish new files you meant to includeI tend to prefer the npmignore
because it's easy to forget to add to the files
list. Either way, you're maintaining a list manually, whether it's a whitelist or a blacklist. The only difference I see personally is that one of those options can cause a painful problem post-publish
I'm sorry, that was a poor choice of words on my behalf.
I suppose what I really wanted to bring up was the non-exclusion of dotfiles and/or github templates. I don't see what good they would do as published files.
Unless of course npm already handles that for you, I can't quite recall what the default ignoreset looks lile for npm publish
.
files vs npmignore; truth be told I don't know full well why I would bring that up.
+1 for files
in package.json
Largely down to preference but I think I'd like to go with files
in package.json
.
Thanks for putting this together @DrewML, I'm picking up PRs at the moment so will modify your commit if you don't mind (so it's still attributed to you).
Merged into master 👍
Would it not make more sense to go with an explicit
files
entry inpackage.json
so as to not publish dotfiles etc.Saves you th hassle of maintaining a blacklist of files that are unnecessary to the consumers.