Skip to content

Commit a63df21

Browse files
committed
fixup! module: unflag esm json modules
1 parent 5fe4f32 commit a63df21

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

doc/api/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ Enable experimental `import.meta.resolve()` support.
296296
added: v12.9.0
297297
-->
298298

299-
Enable experimental JSON support for the ES Module loader.
299+
This option is a no-op. It is kept for compatibility.
300300

301301
### `--experimental-loader=module`
302302

doc/api/esm.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -477,22 +477,6 @@ These CommonJS variables are not available in ES modules.
477477
`__filename` and `__dirname` use cases can be replicated via
478478
[`import.meta.url`][].
479479
480-
#### No JSON Module Loading
481-
482-
JSON imports are still experimental and only supported via the
483-
`--experimental-json-modules` flag.
484-
485-
Local JSON files can be loaded relative to `import.meta.url` with `fs` directly:
486-
487-
<!-- eslint-skip -->
488-
489-
```js
490-
import { readFile } from 'fs/promises';
491-
const json = JSON.parse(await readFile(new URL('./dat.json', import.meta.url)));
492-
```
493-
494-
Alternatively `module.createRequire()` can be used.
495-
496480
#### No Native Module Loading
497481
498482
Native modules are not currently supported with ES module imports.
@@ -538,7 +522,7 @@ import packageConfig from './package.json' assert { type: 'json' };
538522
539523
The `assert { type: 'json' }` syntax is mandatory; see [Import Assertions][].
540524
541-
The imported JSON only exposes a `default`. There is no support for named
525+
The imported JSON only exposes a `default` export. There is no support for named
542526
exports. A cache entry is created in the CommonJS cache to avoid duplication.
543527
The same object is returned in CommonJS if the JSON module has already been
544528
imported from the same path.

test/es-module/test-esm-json.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ strictEqual(secret.ofLife, 42);
99

1010
// Test warning message
1111
const child = spawn(process.execPath, [
12-
'--experimental-json-modules',
1312
path('/es-modules/json-modules.mjs'),
1413
]);
1514

0 commit comments

Comments
 (0)