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
Add support for Yarn v2 #2799
Merged
Merged
Add support for Yarn v2 #2799
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Dec 2, 2020
@doits I've tested your branch and it works for me 👍 |
I'm waiting for rails/rails#40722 to be merged but I'm not sure it will be in time for Rails 6.1 :/ |
This should make Webpacker support both Yarn 1 and 2. It comes down to the two changes: - Use correct `yarn install` flags - Add `webpack` and `webpack-cli` as direct per project dependencies, otherwise Yarn 2 complains about not finding the binary `webpack` In addition `nodeLinker: node-modules` must be added to `.yarnrc.yml` for maximum compatibility, but this is left as an exercise for the user who wants to experiment with Yarn 2 for now.
rails/rails#40722 is merged 👏 even into https://github.com/rails/rails/tree/6-1-stable – maybe this can be merged, too? |
Hi there! Any news? |
This was referenced Jan 15, 2021
Yarn 3 is now out. :( |
Great news! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should make Webpacker support both Yarn 1 and 2. It comes down to the two changes:
yarn install
flagswebpack
andwebpack-cli
as direct per project dependencies, otherwise Yarn 2 complains about not finding the binarywebpack
In addition
nodeLinker: node-modules
must be added to.yarnrc.yml
for maximum compatibility, but this is left as an exercise for the user who wants to experiment with Yarn 2 for now.I think supporting both Yarn versions – if those are really the only two changes – should be no problem. Later one could force to only supprt Yarn 2, but Rails must gain support for Yarn 2 before. See rails/rails#40722 for Yarn 2 support in Rails.