package.json files & .npmignore
The “files” field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder. (Unless they would be ignored by another rule.) You can also provide a “.npmignore” file in the root of your package or in subdirectories, which will keep files from being included, even if they would be picked up by the files array. The .npmignore file works just like a .gitignore.
- package.json files 就是白名单, 不写这个字段就默认是所有文件
.npmignore则是黑名单, 排除掉, 即使在 files 里写了, 还是会排除掉. 该文件还可以写在子文件夹中
.git CVS .svn .hg .lock-wscript .wafpickle-N *.swp .DS_Store ._* npm-debug.log
LICENSE 写在 files 里, 今天再查发现它们会自动包含…
为宇宙的熵增着想, 我们应该忽略它, let npm take care of it…