You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m working on a Yarn 4.9+ setup where I need to intercept or inject logic before Yarn reads environment variables or configuration files (e.g. .yarnrc.yml). Specifically, I want to influence env vars or project-specific settings dynamically, without requiring wrapper scripts or forking Yarn.
This would ideally allow early logic to run before things like:
Configuration.find(...)
.yarnrc.yml resolution
Plugin loading (which currently depends on config being resolved)
Use Case
We’re exploring an internal security authentication that:
Authenticates and sets sensitive env vars dynamically
Needs to happen before Yarn pulls in plugin configs or variables from .yarnrc.yml
Currently we’re working around this using:
Custom wrapper scripts but this either requires devs to run an extra command on top of yarn install or requires us to inject code into developers' profiles.
But we'd prefer a cleaner, officially supported way to hook into this lifecycle point — ideally something like:
Why the Current Plugins Don’t Work Today
Plugins (like validateProject) are only loaded after the configuration is already resolved. This prevents using them to modify config or envs that Yarn has already cached or used.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I’m working on a Yarn 4.9+ setup where I need to intercept or inject logic before Yarn reads environment variables or configuration files (e.g. .yarnrc.yml). Specifically, I want to influence env vars or project-specific settings dynamically, without requiring wrapper scripts or forking Yarn.
This would ideally allow early logic to run before things like:
Configuration.find(...)
.yarnrc.yml resolution
Plugin loading (which currently depends on config being resolved)
Use Case
We’re exploring an internal security authentication that:
Currently we’re working around this using:
But we'd prefer a cleaner, officially supported way to hook into this lifecycle point — ideally something like:
Why the Current Plugins Don’t Work Today
Plugins (like validateProject) are only loaded after the configuration is already resolved. This prevents using them to modify config or envs that Yarn has already cached or used.
Beta Was this translation helpful? Give feedback.
All reactions