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

fix: prevent yarn 2+ error in assets:precompile #241

Merged
merged 1 commit into from
Aug 28, 2022

Conversation

pftg
Copy link
Contributor

@pftg pftg commented Aug 22, 2022

Description 📖

For Yarn 2+, YARN_PRODUCTION=false causes Usage Error: Unrecognized or legacy configuration settings found: production - run "yarn config -v" to see the list of settings supported in Yarn (in <environment>)

Background 📜

Because there is no such global configuration for Yarn 2+, at least I have not found any similar on https://yarnpkg.com/configuration/yarnrc, we got the issue

The Fix 🔨

Do not add env to prevent warning message if yarn version is more than 1

Screenshots 📷

image

@pftg pftg changed the title Do not set YARN_PRODUCTION for yarn 2 Prevents error message for Yarn 2+ on assets:precompile Aug 22, 2022
@pftg
Copy link
Contributor Author

pftg commented Aug 25, 2022

@ElMassimo could you check?

@ElMassimo
Copy link
Owner

It's been 3 days Paul, don't be pushy 😄

I'll check when I have time to review it.

@ElMassimo
Copy link
Owner

Yarn's migration guide mentions that selecting which dependencies are installed (dev or prod) requires the workspace-tools plugin.

Since a user might not have workspace enabled in the project, I think that the change in this pull request makes sense.

This also means it's now the user's responsibility to ensure any build dependencies are available when vite build is run.


Thanks for your contribution Paul! 😃

@ElMassimo ElMassimo changed the title Prevents error message for Yarn 2+ on assets:precompile fix: prevent yarn 2+ error in assets:precompile Aug 28, 2022
@ElMassimo ElMassimo merged commit e7e857a into ElMassimo:main Aug 28, 2022
@pftg pftg deleted the support-yarn-3 branch August 28, 2022 20:05
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

Successfully merging this pull request may close these issues.

2 participants