When publishing a nodejs package, some files are uploaded to npm but not uploaded to Github. Why?
For example, the package is assets-webpack-plugin
.
In the files
section of its package.json it includes dist/
:
"files": [
"index.js",
"dist/"
],
But in the .gitignore
file it still includes dist
:
node_modules
dist
tmp
npm-debug.log*
.package.json
# Lock files shouldn't be committed for libraries https://stackoverflow.com/a/40206145
yarn.lock
package-lock.json
The question is why does the project on Github ignore the files while npm has to contain them? Now that they are in package.json
's files
section, which means these file(s) are important to the package - why .gitignore
them?