@@ -941,6 +941,69 @@ files with no extension will be treated as WebAssembly if they begin with the
941941WebAssembly magic number (` \0asm ` ); otherwise they will be treated as ES module
942942JavaScript.
943943
944+ ### ` --experimental-config-file `
945+
946+ <!-- YAML
947+ added: REPLACEME
948+ -->
949+
950+ > Stability: 1.0 - Early development
951+
952+ Use this flag to specify a configuration file that will be loaded and parsed
953+ before the application starts.
954+ Node.js will read the configuration file and apply the settings.
955+ The configuration file should be a JSON file
956+ with the following structure:
957+
958+ ``` json
959+ {
960+ "$schema" : " https://nodejs.org/dist/REPLACEME/docs/node_config_json_schema.json" ,
961+ "experimental-transform-types" : true ,
962+ "import" : [
963+ " amaro/transform"
964+ ],
965+ "disable-warning" : " ExperimentalWarning" ,
966+ "watch-path" : " src" ,
967+ "watch-preserve-output" : true
968+ }
969+ ```
970+
971+ Only flags that are allowed in [ ` NODE_OPTIONS ` ] [ ] are supported.
972+ No-op flags are not supported.
973+ Not all V8 flags are currently supported.
974+
975+ It is possible to use the [ official JSON schema] ( ../node_config_json_schema.json )
976+ to validate the configuration file, which may vary depending on the Node.js version.
977+ Each key in the configuration file corresponds to a flag that can be passed
978+ as a command-line argument. The value of the key is the value that would be
979+ passed to the flag.
980+
981+ For example, the configuration file above is equivalent to
982+ the following command-line arguments:
983+
984+ ``` bash
985+ node --experimental-transform-types --import amaro/transform --disable-warning=ExperimentalWarning --watch-path=src --watch-preserve-output
986+ ```
987+
988+ The priority in configuration is as follows:
989+
990+ 1 . NODE\_ OPTIONS and command-line options
991+ 2 . Configuration file
992+ 3 . Dotenv NODE\_ OPTIONS
993+
994+ Values in the configuration file will not override the values in the environment
995+ variables and command-line options, but will override the values in the ` NODE_OPTIONS `
996+ env file parsed by the ` --env-file ` flag.
997+
998+ If duplicate keys are present in the configuration file, only
999+ the first key will be used.
1000+
1001+ The configuration parser will throw an error if the configuration file contains
1002+ unknown keys or keys that cannot used in ` NODE_OPTIONS ` .
1003+
1004+ Node.js will not sanitize or perform validation on the user-provided configuration,
1005+ so ** NEVER** use untrusted configuration files.
1006+
9441007### ` --experimental-eventsource `
9451008
9461009<!-- YAML
0 commit comments