| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 19b943b commit 6c24155
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -69,13 +69,14 @@ expressions: | |||
| 69 | 69 | * Strings passed in as an argument to `--eval`, or piped to `node` via `STDIN`, | |
| 70 | 70 | with the flag `--input-type=module`. | |
| 71 | 71 | ||
| 72 | - * Code that contains syntax that only parses successfully as [ES modules][], | ||
| 73 | - such as `import` or `export` statements or `import.meta`, when the code has no | ||
| 74 | - explicit marker of how it should be interpreted. Explicit markers are `.mjs` | ||
| 75 | - or `.cjs` extensions, `package.json` `"type"` fields with either `"module"` or | ||
| 76 | - `"commonjs"` values, or `--input-type` or `--experimental-default-type` flags. | ||
| 77 | - Dynamic `import()` expressions are supported in either CommonJS or ES modules | ||
| 78 | - and would not cause a file to be treated as an ES module. | ||
| 72 | + * When using [`--experimental-detect-module`][], code containing syntax only | ||
| 73 | + successfully parsed as [ES modules][], such as `import` or `export` | ||
| 74 | + statements or `import.meta`, having no explicit marker of how it should be | ||
| 75 | + interpreted. Explicit markers are `.mjs` or `.cjs` extensions, `package.json` | ||
| 76 | + `"type"` fields with either `"module"` or `"commonjs"` values, or | ||
| 77 | + `--input-type` or `--experimental-default-type` flags. Dynamic `import()` | ||
| 78 | + expressions are supported in either CommonJS or ES modules and would not | ||
| 79 | + cause a file to be treated as an ES module. | ||
| 79 | 80 | ||
| 80 | 81 | Node.js will treat the following as [CommonJS][] when passed to `node` as the | |
| 81 | 82 | initial input, or when referenced by `import` statements or `import()` | |
@@ -1362,6 +1363,7 @@ This field defines [subpath imports][] for the current package. | |||
| 1362 | 1363 | [`"type"`]: #type | |
| 1363 | 1364 | [`--conditions` / `-C` flag]: #resolving-user-conditions | |
| 1364 | 1365 | [`--experimental-default-type`]: cli.md#--experimental-default-typetype | |
| 1366 | + [`--experimental-detect-module`]: cli.md#--experimental-detect-module | ||
| 1365 | 1367 | [`--no-addons` flag]: cli.md#--no-addons | |
| 1366 | 1368 | [`ERR_PACKAGE_PATH_NOT_EXPORTED`]: errors.md#err_package_path_not_exported | |
| 1367 | 1369 | [`esm`]: https://github.com/standard-things/esm#readme | |
| Back | FazBrowse Home | New Git URL |
0 commit comments