@@ -1702,7 +1702,7 @@ Running `node --import 'data:text/javascript,import { register } from "node:modu
1702
1702
or ` node --import ./import-map-sync-hooks.js main.js`
1703
1703
should print ` some module!` .
1704
1704
1705
- ## Source map v3 support
1705
+ ## Source Map Support
1706
1706
1707
1707
<!-- YAML
1708
1708
added:
@@ -1712,13 +1712,17 @@ added:
1712
1712
1713
1713
> Stability: 1 - Experimental
1714
1714
1715
- Helpers for interacting with the source map cache. This cache is
1716
- populated when source map parsing is enabled and
1715
+ Node.js supports TC39 ECMA-426 [Source Map][] format (it was called Source map
1716
+ revision 3 format).
1717
+
1718
+ The APIs in this section are helpers for interacting with the source map
1719
+ cache. This cache is populated when source map parsing is enabled and
1717
1720
[source map include directives][] are found in a modules' footer.
1718
1721
1719
1722
To enable source map parsing, Node.js must be run with the flag
1720
1723
[` --enable-source-maps` ][], or with code coverage enabled by setting
1721
- [` NODE_V8_COVERAGE=dir` ][].
1724
+ [` NODE_V8_COVERAGE=dir` ][], or be enabled programmatically via
1725
+ [` module.setSourceMapsSupport()` ][].
1722
1726
1723
1727
` ` ` mjs
1724
1728
// module.mjs
@@ -1812,7 +1816,7 @@ changes:
1812
1816
1813
1817
Creates a new ` sourceMap` instance.
1814
1818
1815
- ` payload` is an object with keys matching the [Source map v3 format][]:
1819
+ ` payload` is an object with keys matching the [Source map format][]:
1816
1820
1817
1821
* ` file` : {string}
1818
1822
* ` version` : {number}
@@ -1903,8 +1907,8 @@ returned object contains the following keys:
1903
1907
[Customization hooks]: #customization-hooks
1904
1908
[ES Modules]: esm.md
1905
1909
[Permission Model]: permissions.md#permission-model
1906
- [Source Map]: https://sourcemaps.info/spec.html
1907
- [Source map v3 format]: https://sourcemaps.info/spec.html#h.mofvlxcwqzej
1910
+ [Source Map]: https://tc39.es/ecma426/
1911
+ [Source map format]: https://tc39.es/ecma426/#sec-source-map-format
1908
1912
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
1909
1913
[V8 code cache]: https://v8.dev/blog/code-caching-for-devs
1910
1914
[` " exports" ` ]: packages.md#exports
@@ -1920,6 +1924,7 @@ returned object contains the following keys:
1920
1924
[` module.enableCompileCache()` ]: #moduleenablecompilecachecachedir
1921
1925
[` module.flushCompileCache()` ]: #moduleflushcompilecache
1922
1926
[` module.getCompileCacheDir()` ]: #modulegetcompilecachedir
1927
+ [` module.setSourceMapsSupport()` ]: #modulesetsourcemapssupportenabled-options
1923
1928
[` module` ]: #the-module-object
1924
1929
[` os.tmpdir()` ]: os.md#ostmpdir
1925
1930
[` registerHooks` ]: #moduleregisterhooksoptions
@@ -1933,7 +1938,7 @@ returned object contains the following keys:
1933
1938
[prefix-only modules]: modules.md#built-in-modules-with-mandatory-node-prefix
1934
1939
[realm]: https://tc39.es/ecma262/#realm
1935
1940
[resolve hook]: #resolvespecifier-context-nextresolve
1936
- [source map include directives]: https://sourcemaps.info/spec.html#h.lmz475t4mvbx
1941
+ [source map include directives]: https://tc39.es/ecma426/#sec-linking-generated-code
1937
1942
[the documentation of ` Worker` ]: worker_threads.md#new-workerfilename-options
1938
1943
[transferable objects]: worker_threads.md#portpostmessagevalue-transferlist
1939
1944
[transform TypeScript features]: typescript.md#typescript-features
0 commit comments