Here is what I have in node_modules when I install my package:
node_modules
Even though I am using this files field in package.json:
files
"files": [ "./dist" ]
Why is that?
SOLVED: It turned out that files field only works when package is published.
Maybe you misunderstood what the files field does:
The optional files field is an array of file patterns that describes the entries to be included when your package is installed as a dependency
The files field is used to define files that should be imported alongside your library when another project install your project as a npm package.
2.1m questions
2.1m answers
60 comments
57.0k users