I created a react library and have my repo in gitlab and installed it using git+http://gitlab.com/[library-name]
I have an example folder to test my react components. I want my example folder to be in my gitlab repository but I want to exclude it in my package files (tarball) during installation.
This is my .gitignore
tmp/*
node_modules
.DS_Store
.sass-cache
update
*.log
.vscode/
This is my .npmignore
tmp/*
node_modules
.DS_Store
.sass-cache
update
*.log
.vscode/
src
example
This is my package.json
"files": [
"bin",
"src",
"public"
],
So as you can see I have listed the example folder in my .npmignore and and package.json listed all the directories I want to include in my tarball but upon installation I still have get the example folder present in the installation files.
If you have it registered in .npmignore, it will ignore it every time you install it, therefore, most likely, you will continue to see the folders of a previous version, try removing the package and installing it again.