Here's a puzzle to noodle on:
Let's say package.json contains this:
{
"files": [
"lib",
"!lib/one",
"lib/two"
]
}
Files in lib/
are: .npmignore
, one
, two
, tre
The file at lib/.npmignore
contains:
two
Which files will be included in the package?
🅰️ :lib/two
,lib/tre
,package.json
🅱️ :lib/tre
,lib/.npmignore
,package.json
(Please don't look it up, the point of the exercise is to gauge expectations.)
Argument for🅰️ :
The
package.json
file specifies what files are to be included. This supersedes any ignore files found throughout the tree.Argument for🅱️ :
There's an ignore file right there! It says to ignore
two
, sotwo
should be ignored.