I have a file that is generated by
From the documentation:
.npmignorefile to keep stuff out of your package. If there's no
.npmignorefile, but there is a
.gitignorefile, then npm will ignore the stuff matched by the
.gitignorefile. If you want to include something that is excluded by your
.gitignorefile, you can create an empty
.npmignorefile to override it.
In general, I'd probably suggest using just the
.gitignore file on its own until there's ever a discrepancy, at which point I'd copy the file and maintain them separately.
More information on what to put in
.npmignore files: Should I .npmignore my tests?