Issue: npmignore is not working as expected


(Fran Cortes) #1

Hi everyone,

Initially, I did a package in my library (let’s say my-library) with this .npmignore file:

.babelrc
.codeclimate.yml
.eslintignore
.eslintrc
.github
.nvmrc
.travis.yml
config_runtime
test
src
scripts
webpack.config.js

and also this .gitignore file:

.DS_Store
dist
node_modules
npm-debug.log
npm-debug.log.*
.nyc_output
coverage

In one of the branches of this project (let’s say my-branch) I have removed this .npmignore file. Nevertheless, when I am trying to add this project with this branch in another package.json of another project like this:

"my-library": "github.com/frankpolite/mylibrary#my-branch"

, node_modules/my-library continues ignoring the /src folder when I am doing npm install :frowning_face: I tried to clean the cache, change the package version of my-library, but it’s not still working :cry:

Do you know some effective way to “restart” or “refresh” the files that the npmignore file are ignored previously?

Thanks in advance.

Frank


(Markus Tacker) #2

You have to explicitly include "src" in the files section of your package.json: https://docs.npmjs.com/files/package.json#files


(Fran Cortes) #3

Yes, it worked! Thanks a lot!


(system) #4

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.