process.setSourceMapsEnabled(val)


新增于: v16.6.0, v14.18.0
稳定性: 1 - 实验:改用 module.setSourceMapsSupport()

\Stability: 1 - Experimental: Use module.setSourceMapsSupport() instead.

此函数启用或禁用 源映射 对堆栈跟踪的支持。

\This function enables or disables the Source Map support for stack traces.

它提供与使用命令行选项 --enable-source-maps 启动 Node.js 进程相同的功能。

\It provides same features as launching Node.js process with commandline options --enable-source-maps.

只有在启用源映射后加载的 JavaScript 文件中的源映射才会被解析和加载。

\Only source maps in JavaScript files that are loaded after source maps has been enabled will be parsed and loaded.

这意味着使用选项 { nodeModules: true, generatedCode: true } 调用 module.setSourceMapsSupport()

\This implies calling module.setSourceMapsSupport() with an option { nodeModules: true, generatedCode: true }.

AltStyle によって変換されたページ (->オリジナル) /