@@ -1568,7 +1568,7 @@ Running `node --import 'data:text/javascript,import { register } from "node:modu
1568
1568
or ` node --import ./import-map-sync-hooks.js main.js`
1569
1569
should print ` some module!` .
1570
1570
1571
- ## Source map v3 support
1571
+ ## Source Map Support
1572
1572
1573
1573
<!-- YAML
1574
1574
added:
@@ -1578,13 +1578,17 @@ added:
1578
1578
1579
1579
> Stability: 1 - Experimental
1580
1580
1581
- Helpers for interacting with the source map cache. This cache is
1582
- populated when source map parsing is enabled and
1581
+ Node.js supports TC39 ECMA-426 [Source Map][] format (it was called Source map
1582
+ revision 3 format).
1583
+
1584
+ The APIs in this section are helpers for interacting with the source map
1585
+ cache. This cache is populated when source map parsing is enabled and
1583
1586
[source map include directives][] are found in a modules' footer.
1584
1587
1585
1588
To enable source map parsing, Node.js must be run with the flag
1586
1589
[` --enable-source-maps` ][], or with code coverage enabled by setting
1587
- [` NODE_V8_COVERAGE=dir` ][].
1590
+ [` NODE_V8_COVERAGE=dir` ][], or be enabled programmatically via
1591
+ [` module.setSourceMapsSupport()` ][].
1588
1592
1589
1593
` ` ` mjs
1590
1594
// module.mjs
@@ -1682,7 +1686,7 @@ changes:
1682
1686
1683
1687
Creates a new ` sourceMap` instance.
1684
1688
1685
- ` payload` is an object with keys matching the [Source map v3 format][]:
1689
+ ` payload` is an object with keys matching the [Source map format][]:
1686
1690
1687
1691
* ` file` : {string}
1688
1692
* ` version` : {number}
@@ -1773,8 +1777,8 @@ returned object contains the following keys:
1773
1777
[Customization hooks]: #customization-hooks
1774
1778
[ES Modules]: esm.md
1775
1779
[Permission Model]: permissions.md#permission-model
1776
- [Source Map]: https://sourcemaps.info/spec.html
1777
- [Source map v3 format]: https://sourcemaps.info/spec.html#h.mofvlxcwqzej
1780
+ [Source Map]: https://tc39.es/ecma426/
1781
+ [Source map format]: https://tc39.es/ecma426/#sec-source-map-format
1778
1782
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
1779
1783
[V8 code cache]: https://v8.dev/blog/code-caching-for-devs
1780
1784
[` " exports" ` ]: packages.md#exports
@@ -1790,6 +1794,7 @@ returned object contains the following keys:
1790
1794
[` module.enableCompileCache()` ]: #moduleenablecompilecachecachedir
1791
1795
[` module.flushCompileCache()` ]: #moduleflushcompilecache
1792
1796
[` module.getCompileCacheDir()` ]: #modulegetcompilecachedir
1797
+ [` module.setSourceMapsSupport()` ]: #modulesetsourcemapssupportenabled-options
1793
1798
[` module` ]: #the-module-object
1794
1799
[` os.tmpdir()` ]: os.md#ostmpdir
1795
1800
[` registerHooks` ]: #moduleregisterhooksoptions
@@ -1802,7 +1807,7 @@ returned object contains the following keys:
1802
1807
[module wrapper]: modules.md#the-module-wrapper
1803
1808
[realm]: https://tc39.es/ecma262/#realm
1804
1809
[resolve hook]: #resolvespecifier-context-nextresolve
1805
- [source map include directives]: https://sourcemaps.info/spec.html#h.lmz475t4mvbx
1810
+ [source map include directives]: https://tc39.es/ecma426/#sec-linking-generated-code
1806
1811
[the documentation of ` Worker` ]: worker_threads.md#new-workerfilename-options
1807
1812
[transferable objects]: worker_threads.md#portpostmessagevalue-transferlist
1808
1813
[transform TypeScript features]: typescript.md#typescript-features
0 commit comments