-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Yarn needs to use .npmignore file when installing from repo #2090
Comments
What's the use case for this? Is it just to install a development version? |
@Daniel15 Already said that in original post...
Or actually any private modules as well. |
Ahhh, so sorry @FredyC, I totally missed that part of your post! For custom forks of open source libraries, one option is to publish them to npm as a namespaced/scoped package (like In any case, this definitely sounds like an improvement we should make :) |
I personally dislike polluting npm registry more than is needed, even with something like scoped packages. Doesn't feel right, but I guess it's possible workaround for now. Either way it wont work for private modules anyway. |
This is a huge deal-breaker for us, would be nice to solve it as soon as possible. Any ideas what strategy could be used for this? I might be interested in solving this issue myself, however, I don't have any other ideas as just checking out full repo and deleting files which match .npmignore/.yarnignore |
Same problem occurs when you try to install from a local directory #685. |
Just ran into this problem myself. I was really surprised by the behavior, and it's causing the associated directory in our We have a private module and share it via a git repository. It's important for us to keep our
|
Hmmm, any news on that? I was just surprised when adding a dependency to a local modules via "[package-name]": "file:../[path]" and found ~300 MB in the imported ~10kb module after yarn install. |
this hurts. importing a lib from git repo to react native. yarn not ignoring .babelrc so getting transform errors when compiling react native app because I don't have the babel transform plugins installed for my app |
Any update on this? It might not be a big deal when developing projects, but it becomes a sticking point when trying to use |
Also got hit by this while trying to use webpack with the angular2+ AOT compiler to compile a project that references a private library which has .ts files along the transpiled .js files. Due to configuration requirements, webpack will default to finding and using the .ts files, but the typescript compiler will refuse to compile anything from Using (Workaround was to reorganize the entire project to store the compiled .js files in a separate directory, so that the .ts files weren't siblings to them.) |
Also seeing this issue which prevents me from using yarn atm 😢 |
Same issue here. |
As @HaykoKoryun said, this is is a huge issue for using yarn in production if you have any private repos relying on .npmignore.
|
A possible workaround is to add a |
Is there a reason that Yarn still doesn't do this? |
Likewise, yarn doesn't respect a |
I would like to say here that I don't think this is that much necessary anymore. Personally, I've opted to use |
@FredyC I don't think yalc solves all the problems that this issue is addressing. It's not just about local development. It's legitimate to have a package.json point at a git repository. |
@rmm5t It may not be apparent from docs, but Yalc maintains They key point here is that you can commit The workflow quite the same. Just clone the fork/private repo and instead of And Yalc respects |
@FredyC Are you sure you're in the right repo? This may not be an issue for the thousands of users of This is still an issue for the millions of developers that use Thanks for your suggestion to switch to |
@waynebloss I am not talking about replacing yarn with yalc. Both are different tools for a different job. It's your choice, I just wanted to show a painless way how to overcome this problem instead of just waiting to get it fixed. Frankly, after 2 years without team response, it looks like one of those stale issues that are not that important to be worried about. |
@FredyC I absolutely agree that it's not a huge issue. For front-end projects, the extra files will never make it into the production code. On the back-end things will end up on the server making my Docker images bigger, but anyone serious about building a lot of private NPM packages is probably going to run a private/cache-forwarding NPM registry. But...it's still an issue. Mostly, I think, because people expect parity with |
We are running into the same issue at Facebook. Is there anyone who is willing to send a Pull Request for this? I'm happy to review it, merge it and make a new release of Yarn for this bugfix. |
I will look into it and try to create a PR |
I opened a pr about that 8010 |
Do you want to request a feature or report a bug?
Feature (I would like think of it as a bug too)
What is the current behavior?
Trying to install
three.js
module from repository instead of registry yields 303MB folder in size. Installing same thing with NPM and resulting folder is just 11MBIf the current behavior is a bug, please provide the steps to reproduce.
yarn init
yarn add github:mrdoob/three.js
What is the expected behavior?
The
.npmignore
file should be used and actually remove files that conforms to globs there. Not sure if it's possible to actually avoid unpacking those files in first place. That would certainly improve performance much more.Reason why to install package from repository is because of custom forks.
Please mention your node.js, yarn and operating system version.
Node 6.9.1, Yarn 0.17.7, Windows 10 x64
The text was updated successfully, but these errors were encountered: