You can also provide a .npmignore file in the root of your package or in subdirectories, which will keep files from being included. At the root of your package it will not override the “files” field, but in subdirectories it will. The .npmignore file works just like a .gitignore. If there is a .gitignore file, and .npmignore is missing, .gitignore’s contents will be used instead.
whitelist = files array + main if declared and found + bin if declared and found
blacklist = .gitignore at root, .npmignore at each dir level.
dealing with .npmignore seems annoying.
blacklist seems annoying. Maybe leave this out for now. 🤷🏻♂️
bin
files included if declared and foundmain
file included if declared and foundmain
defaults toindex.js
when the module is required butindex.js
is not automatically included in packfiles
defaults to[*]
but really it is[**]
https://docs.npmjs.com/files/package.json#directories directories is another way to add files - but doesn't really seem thought through so not going to support it for now.
dealing with .npmignore: https://docs.npmjs.com/files/package.json#files
whitelist = files array + main if declared and found + bin if declared and found blacklist = .gitignore at root, .npmignore at each dir level. dealing with .npmignore seems annoying.
blacklist seems annoying. Maybe leave this out for now. 🤷🏻♂️