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

Yarn v2 support #154

Closed
pustovalov opened this issue Jan 28, 2020 · 3 comments
Closed

Yarn v2 support #154

pustovalov opened this issue Jan 28, 2020 · 3 comments

Comments

@pustovalov
Copy link
Contributor

pustovalov commented Jan 28, 2020

Hey,

I have this declaration for size-limit in package.json

"devDependencies": {
  "@size-limit/preset-app": "^3.0.0",
  "@size-limit/webpack": "^3.0.0"
}

with yarn v1 everything worked well, but with yarn 2 and PnP, I got this an error message:

[~/site-new]$ yarn size                                                                                                                                               
Usage Error: Couldn't find a script named "size-limit".

$ yarn run <scriptName> ...
[~/site-new]$ yarn bin                                                                                                                                               
➤ YN0000: husky-run
➤ YN0000: husky-upgrade
➤ YN0000: lint-staged
➤ YN0000: prettier
➤ YN0000: sass
➤ YN0000: webpack
➤ YN0000: webpack-bundle-analyzer
➤ YN0000: webpack-cli
➤ YN0000: webpack-dev-server
➤ YN0000: Done in 0.04s

After I changed the declaration to:

"devDependencies": {
  "@size-limit/preset-app": "^3.0.0",
  "@size-limit/webpack": "^3.0.0",
  "size-limit": "^3.0.0"
}
[~/site-new]$ yarn size                                                                                                                                               
 WARN  You can remove size-limit dependency
       All plugins and presets already contain it as own dependency
       yarn remove size-limit

[~/site-new]$ yarn bin                                                                                                                                                
➤ YN0000: husky-run
➤ YN0000: husky-upgrade
➤ YN0000: lint-staged
➤ YN0000: prettier
➤ YN0000: sass
➤ YN0000: size-limit
➤ YN0000: webpack
➤ YN0000: webpack-bundle-analyzer
➤ YN0000: webpack-cli
➤ YN0000: webpack-dev-server
➤ YN0000: Done in 0.05s
@pustovalov
Copy link
Contributor Author

as I understand yarn 2 applies binaries only from first level dependencies, discussion with the maintainer of yarnpkg:
dis

@ai
Copy link
Owner

ai commented Jan 30, 2020

We can change Install instruction to explicitly ask to add size-limit to dependencies and remove the warning.

@pustovalov
Copy link
Contributor Author

I can make a PR for these changes, today or tomorrow

@ai ai closed this as completed Jan 31, 2020
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

2 participants