| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8fc9cb9 commit 12be49a
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1091,6 +1091,44 @@ The configuration file supports namespace-specific options: | |||
| 1091 | 1091 | ||
| 1092 | 1092 | * Namespace fields like `test`, `watch`, and `permission` contain configuration specific to that subsystem. | |
| 1093 | 1093 | ||
| 1094 | + The configuration file can target a specific Node.js major version with | ||
| 1095 | + `nodeVersion`: | ||
| 1096 | + | ||
| 1097 | + ```json | ||
| 1098 | + { | ||
| 1099 | + "nodeVersion": 25, | ||
| 1100 | + "nodeOptions": { | ||
| 1101 | + "watch-path": "src" | ||
| 1102 | + } | ||
| 1103 | + } | ||
| 1104 | + ``` | ||
| 1105 | + | ||
| 1106 | + To keep multiple version-specific configurations in the same file, use the | ||
| 1107 | + `configs` array. Node.js will use the first entry whose `nodeVersion` matches | ||
| 1108 | + the current Node.js major version: | ||
| 1109 | + | ||
| 1110 | + ```json | ||
| 1111 | + { | ||
| 1112 | + "$schema": "https://nodejs.org/dist/latest-v26.x/docs/node-config-schema.json", | ||
| 1113 | + "configs": [ | ||
| 1114 | + { | ||
| 1115 | + "nodeVersion": 25, | ||
| 1116 | + "config": { | ||
| 1117 | + "$schema": "https://nodejs.org/dist/latest-v25.x/docs/node-config-schema.json", | ||
| 1118 | + "nodeOptions": { | ||
| 1119 | + "watch-path": "src" | ||
| 1120 | + } | ||
| 1121 | + } | ||
| 1122 | + } | ||
| 1123 | + ] | ||
| 1124 | + } | ||
| 1125 | + ``` | ||
| 1126 | + | ||
| 1127 | + When `configs` is used, the top level may only contain `$schema` and | ||
| 1128 | + `configs`. Each `configs` item must define an integer `nodeVersion` and an | ||
| 1129 | + object `config`. A single top-level config does not require `nodeVersion`, but | ||
| 1130 | + if present it must match the current Node.js major version. | ||
| 1131 | + | ||
| 1094 | 1132 | When a namespace is present in the | |
| 1095 | 1133 | configuration file, Node.js automatically enables the corresponding flag | |
| 1096 | 1134 | (e.g., `--test`, `--watch`, `--permission`). This allows you to configure | |
| Back | FazBrowse Home | New Git URL |
0 commit comments