yarn config set — Yarn CLI reference
Set a configuration value
yarn config set
Set a configuration value
This command writes a configuration setting to the project configuration file by default. Use -H,--home to write to the home configuration file instead.
Without --json, the value is interpreted according to the setting type: primitive values can be passed directly, while arrays and objects are parsed from JSON.
With --json, the value is always parsed as JSON before it is written.
Values are written in their canonical form, which yarn config get also prints: for example durations always get an explicit unit, using the largest one that represents them exactly (3h, 90m, 1d, 0s). The entries of settings accepting arbitrary keys (such as npmScopes or npmRegistries) are created when they don’t exist yet.
Write to the home configuration file instead of the project file
Parse the value as JSON before writing it
Examples#
Set a simple configuration setting (a string, a number, or a boolean)
Set a complex configuration setting (an Array) using the --json flag
Set a complex configuration setting (an Object) using the --json flag
Set a configuration setting in the home configuration file