Skip to content

Commit 3fbd59a

Browse files
committed
docs: Update docs on environment variable substitution in configuration
1 parent 838778d commit 3fbd59a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/docusaurus/static/configuration/yarnrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "JSON Schema for Yarnrc files",
33
"$schema": "https://json-schema.org/draft/2019-09/schema#",
4-
"description": "Yarnrc files (named this way because they must be called `.yarnrc.yml`) are the one place where you'll be able to configure Yarn's internal settings. While Yarn will automatically find them in the parent directories, they should usually be kept at the root of your project (often your repository). **Starting from the v2, they must be written in valid Yaml and have the right extension** (simply calling your file `.yarnrc` won't do).\n\nEnvironment variables can be accessed from setting definitions by using the `${NAME}` syntax when defining the values. By default Yarn will require the variables to be present, but this can be turned off by using either `${NAME-fallback}` (which will return `fallback` if `NAME` isn't set) or `${NAME:-fallback}` (which will return `fallback` if `NAME` isn't set, or is an empty string).\n\nFinally, note that most settings can also be defined through environment variables (at least for the simpler ones; arrays and objects aren't supported yet). To do this, just prefix the names and write them in snake case: `YARN_CACHE_FOLDER` will set the cache folder (such values will overwrite any that might have been defined in the RC files - use them sparingly).",
4+
"description": "Yarnrc files (named this way because they must be called `.yarnrc.yml`) are the one place where you'll be able to configure Yarn's internal settings. While Yarn will automatically find them in the parent directories, they should usually be kept at the root of your project (often your repository). **Starting from the v2, they must be written in valid Yaml and have the right extension** (simply calling your file `.yarnrc` won't do).\n\nEnvironment variable expansion is available in the following forms:\n- `${NAME}` expands to the value of the variable `NAME` and throws if it is not set\n- `${NAME:-fallback}` expands to the value of `NAME` if it is set and not empty, or the expansion of `fallback` otherwise\n- `${NAME-fallback}` expands to the value of `NAME` if it is set, or the expansion of `fallback` otherwise\n\n`$`, `\\`, and `}` can be escaped by preceding them with a `\\`. All other `\\`s and unmatched `}` are treated literally. Unclosed expansions and unescaped `${` sequences that are not recognized as an expansion throw errors.\n\nFinally, note that most settings can also be defined through environment variables (at least for the simpler ones; arrays and objects aren't supported yet). To do this, just prefix the names and write them in snake case: `YARN_CACHE_FOLDER` will set the cache folder (such values will overwrite any that might have been defined in the RC files - use them sparingly).",
55
"__info": [
66
"This file contains the JSON Schema for Yarnrc files and is:",
77
"1) Hosted on the Yarn Website at http://yarnpkg.com/configuration/yarnrc.json",

0 commit comments

Comments
 (0)