Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.gitignore in ignored directory causes exclusions to be packed #7804

Open
code-asher opened this issue Jan 7, 2020 · 0 comments
Open

.gitignore in ignored directory causes exclusions to be packed #7804

code-asher opened this issue Jan 7, 2020 · 0 comments

Comments

@code-asher
Copy link

Do you want to request a feature or report a bug?

Bug.

What is the current behavior?
A .gitignore in an ignored directory with an exclusion (!) will cause the exclusions to be packed. This also makes yarn pack slow when the ignored directory is large enough.

My use case is that I have a submodule (Node itself) which I'm trying to ignore when packaging.

If the current behavior is a bug, please provide the steps to reproduce.

mkdir test
cd test
yarn init -y
echo lib > .npmignore
mkdir lib
touch lib/test
echo '!test' > lib/.gitignore
yarn pack
tar -tf *.tgz
package
package/lib
package/package.json
package/lib/test

What is the expected behavior?

package
package/package.json

Assuming this is the correct behavior I think the solution would be to avoid descending into ignored directories.

If there is any way of achieving this with Yarn as-is I'm all ears.

Please mention your node.js, yarn and operating system version.
Node: 12.14.0
Yarn: 1.21.1
OS: Arch Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant