I generated a lib folder with Rollup for my npm package.
This is my lib folder structure:
/lib
/components
/stories
In my package.json, I white listed the /lib folder in the files key like so:
// package.json
{
"files": [
"/lib"
]
}
What I wish to achieve is to exclude the /stories when I npm publish
So I added a .npmignore file with the following content:
// .npmignore
/lib/stories
But this isn't working, the /stories folder are still included when I publish.
You need a trailing slash to mark your
stories
as directory. Otherwise .npmignore thinks it's a file:/lib/stories/