@@ -911,29 +911,30 @@ added: v23.6.0
911
911
912
912
Enable experimental import support for ` .node ` addons.
913
913
914
- ### ` --experimental-config-file `
914
+ ### ` --experimental-config-file=path `
915
915
916
916
<!-- YAML
917
917
added: REPLACEME
918
918
-->
919
919
920
920
> Stability: 1.0 - Early development
921
921
922
- Use this flag to specify a configuration file that will be loaded and parsed
923
- before the application starts .
922
+ If present, Node.js will look for a
923
+ configuration file at the specified path .
924
924
Node.js will read the configuration file and apply the settings.
925
925
The configuration file should be a JSON file
926
926
with the following structure:
927
927
928
+ > \[ !NOTE]
929
+ > Replace ` vX.Y.Z ` in the ` $schema ` with the version of Node.js you are using.
930
+
928
931
``` json
929
932
{
930
- "$schema" : " https://nodejs.org/dist/REPLACEME /docs/node_config_json_schema .json" ,
933
+ "$schema" : " https://nodejs.org/dist/vX.Y.Z /docs/node-config-schema .json" ,
931
934
"nodeOptions" : {
932
- "experimental-transform-types" : true ,
933
935
"import" : [
934
- " amaro/transform "
936
+ " amaro/strip "
935
937
],
936
- "disable-warning" : " ExperimentalWarning" ,
937
938
"watch-path" : " src" ,
938
939
"watch-preserve-output" : true
939
940
}
@@ -944,7 +945,7 @@ In the `nodeOptions` field, only flags that are allowed in [`NODE_OPTIONS`][] ar
944
945
No-op flags are not supported.
945
946
Not all V8 flags are currently supported.
946
947
947
- It is possible to use the [ official JSON schema] ( ../node_config_json_schema .json )
948
+ It is possible to use the [ official JSON schema] ( ../node-config-schema .json )
948
949
to validate the configuration file, which may vary depending on the Node.js version.
949
950
Each key in the configuration file corresponds to a flag that can be passed
950
951
as a command-line argument. The value of the key is the value that would be
@@ -954,7 +955,7 @@ For example, the configuration file above is equivalent to
954
955
the following command-line arguments:
955
956
956
957
``` bash
957
- node --experimental-transform-types -- import amaro/transform --disable-warning=ExperimentalWarning --watch-path=src --watch-preserve-output
958
+ node --import amaro/strip --watch-path=src --watch-preserve-output
958
959
```
959
960
960
961
The priority in configuration is as follows:
@@ -976,6 +977,18 @@ unknown keys or keys that cannot used in `NODE_OPTIONS`.
976
977
Node.js will not sanitize or perform validation on the user-provided configuration,
977
978
so ** NEVER** use untrusted configuration files.
978
979
980
+ ### ` --experimental-default-config-file `
981
+
982
+ <!-- YAML
983
+ added: REPLACEME
984
+ -->
985
+
986
+ > Stability: 1.0 - Early development
987
+
988
+ If the ` --experimental-default-config-file ` flag is present, Node.js will look for a
989
+ ` node.config.json ` file in the current working directory and load it as a
990
+ as configuration file.
991
+
979
992
### ` --experimental-eventsource `
980
993
981
994
<!-- YAML
0 commit comments