源映射 v3 支持


¥Source map v3 support

稳定性: 1 - 实验性的

¥Stability: 1 - Experimental

与源映射缓存交互的助手。当启用源映射解析并且在模块的页脚中找到 源映射包含指令 时,将填充此缓存。

¥Helpers for interacting with the source map cache. This cache is populated when source map parsing is enabled and source map include directives are found in a modules' footer.

要启用源映射解析,则 Node.js 必须使用标志 --enable-source-maps 运行、或者通过设置 NODE_V8_COVERAGE=dir 启用代码覆盖率。

¥To enable source map parsing, Node.js must be run with the flag --enable-source-maps, or with code coverage enabled by setting NODE_V8_COVERAGE=dir.

// module.mjs
// In an ECMAScript module
import { findSourceMap, SourceMap } from 'node:module';// module.cjs
// In a CommonJS module
const { findSourceMap, SourceMap } = require('node:module');

Node.js 中文网 - 粤ICP备13048890号