typescript - inlineSourceMap 和 inlineSources typescript 编译器选项之间的区别

标签 typescript

来自文档:

--inlineSourceMap and inlineSources command line options: --inlineSourceMap causes source map files to be written inline in the generated .js files instead of in a independent .js.map file. --inlineSources allows for additionally inlining the source .ts file into the .js file.

这是否意味着完整的文件源已写入输出文件?你为什么想做这个?无论如何,您都可以使用源映射再次重建原始源。

最佳答案

显然,typescript sourcemaps 的默认行为是将开发工具重定向到原始源文件,而不是将它们包含到 sourcemaps 中。

这意味着如果没有 inlineSourceMap: true,您需要提供原始的 .ts 文件以及您的捆绑代码。

设置 inlineSourceMap: true 将此默认行为更改为我期望 typescript 开箱即用的行为:将源信息包含到源映射中。这样,您就不需要随应用程序包一起提供原始源文件。

关于typescript - inlineSourceMap 和 inlineSources typescript 编译器选项之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43291677/

相关文章:

angular - 将类导出为 Angular2 中的接口(interface)

typescript - RXJS bufferedAmount/累加值/减少并重置

javascript - TypeScript tsconfig 某些文件夹中的输出文件

typescript - 如何防止使用 TypeScript 推断泛型类型参数?

node.js - Observable.fromPromise 仅在 CircleCI 上构建时不存在

javascript - 我可以在没有 RequireJS 的情况下使用 TypeScript 吗?

typescript - 条件泛型的返回类型不正确

angular - 如何在 Angular 2 中迭代 JSON 对象?

angular - NGXS:属性 'stream$' 在初始化之前使用

javascript - 填写hr :min values in array of objects up to 24 hours back