question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] Add `--mode=skip-build` to `yarn workspaces focus --production`

See original GitHub issue
  • I’d be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn’t do

Describe the user story

I have Docker image with my Node.js app. For performance and security reasons, I need:

  1. Install only dependencies, not devDependnecies.
  2. Do not run scripts like install

I found that I can use yarn workspaces focus --production to install production dependencies, but yarn workspaces focus have no support for --mode=skip-build.

Describe the solution you’d like

yarn workspaces focus --production --mode=skip-build

Describe the drawbacks of your solution

Do not see from my area of expertise.

Describe alternatives you’ve considered

My current solution is:

RUN yarn plugin import workspace-tools
RUN yarn install --mode=skip-build --immutable
RUN yarn workspaces focus --production

But it is slow.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
aicommented, Oct 7, 2021

explains what causes it to re-run postinstall scripts

Oh 😰 Can we add skip-build to yarn workspaces focus?

0reactions
zyf0330commented, Nov 30, 2022

@ai Hello, I know that yarn has a config option enableScripts which disables postinstall script. And yarn is different with npm, yarn doesn’t execute scripts except postinstall inside the install step.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`yarn workspaces focus` | Yarn - Package Manager
Details. This command will run an install as if the specified workspaces (and all other workspaces they depend on) were the only ones...
Read more >
[Feature] "yarn workspaces focus" option --prune-cache #1789
The documentation for yarn berry says to use the yarn workspaces focus --production command as a replacement for yarn install --production .
Read more >
When Using Yarn Workspaces How To Install Every ... - ADocLib
yarn workspaces focus.Plugin.To use this command first install the workspacetools plugin: yarn plugin import workspacetools.
Read more >
`yarn workspaces focus` - JavaScript 软件包管理器 - Yarn 中文网
Install a single workspace and its dependencies. ... yarn workspaces focus ... Combine with --production to replicate the old yarn install --production ....
Read more >
Yarn install production dependencies of a single package in ...
The --focus flag is broken https://github.com/yarnpkg/yarn/issues/6715 # Avoid the target workspace dependencies to land in the root ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found