--enable-source-maps


启用 Source Map v3 对堆栈跟踪的支持。

当使用转译器(例如 TypeScript)时,应用程序抛出的堆栈跟踪会引用转译后的代码,而不是原始的源位置。 --enable-source-maps 启用源映射缓存并尽最大努力报告相对于原始源文件的堆栈跟踪。

覆盖 Error.prepareStackTrace 可以阻止 --enable-source-maps 修改堆栈跟踪。

Enable Source Map v3 support for stack traces.

When using a transpiler, such as TypeScript, strack traces thrown by an application reference the transpiled code, not the original source position. --enable-source-maps enables caching of Source Maps and makes a best effort to report stack traces relative to the original source file.

Overriding Error.prepareStackTrace prevents --enable-source-maps from modifiying the stack trace.