-
Notifications
You must be signed in to change notification settings - Fork 3k
npm doesn't respect .gitignore if ignored folder has an index.js in it. #3968
Comments
is anyone able to reproduce this? here is what i am doing:
|
also do |
old issue, but as it's still open, i'll try to help close it. What you describe is now the desired behaviour as mentioned in the docs, keeping-files-out-of-your-package:
|
@peter-mouland This is the opposite of that. |
\cc @zkat |
@jdalton Added to the milestone! Thanks a ton for the ping :) |
@jdalton Hey so, I looked at this a little closer. I can't reproduce the behavior you described, for a couple of expected reasons:
Based on that, and unless I'm misunderstanding your report, this seems to be working as intended. Is that the case? |
That would explain why an empty .npmignore lets things through that .gitignore is ignoring. |
Indeed. I think you already know about it, but there's a nice wiki page now that goes into detail about how this stuff works. Since things seem to be working as expected, I'm closing this. There's a couple of issues/PRs that might affect this behavior, too, if you want to keep an eye on them or put in your 2c, specifically #12331 and #11669. Cheers 💃 |
Thanks! |
I noticed this behavior.
If my
.gitignore
looks like:and I run
npm pack
the package will contain the folders
mobile
andlegacy
if there is anindex.js
file in them. If I remove theindex.js
file it will ignore them.The workaround atm is to include
mobile
andlegacy
in the.npmignore
file as well.The text was updated successfully, but these errors were encountered: