--inlineSourceMap or --sourceMap in tsconfig.json
Asked Answered
M

1

6

Must I turn on --inlineSourceMap instead --sourceMap in tsconfig.json when I use cheap-module-eval-source-map as devtool in webpack?

Melamine answered 6/3, 2019 at 13:0 Comment(2)
Yes, you need { "compilerOptions": { "sourceMap": true } } in tsconfig.json.Brittni
Thank you for answer! But I don't know what option I need select --inlineSourceMap or just --sourceMapMelamine
V
9

The option --sourceMap tells the compiler that you want the source map generation. The next question is if you want them as separate files .js.map or not.

The option --inlineSourceMap will put generated source maps inside your .js file.

There is yet another option --inlineSources. This one will create a separate .js.map file, which will include the original TypeScript source so you don't need to deploy your .ts files under the server.

Visually answered 6/3, 2019 at 18:57 Comment(1)
Thank you! I will try to reformulate the question :) I set up webpack for dev and prod environments, in prod mode I use source-map as devtool in webpack config and --sourceMap option in typescript, but in dev mode I use cheap-module-eval-source-map as devtool. cheap-module-eval-source-map will put generated source maps inside .js file, but I still use --sourceMap option in typescript now. So, my question is: Must I use --inlineSourceMap instead --sourceMap in tsconfig.json for dev mode? Best wishes!Melamine

© 2022 - 2024 — McMap. All rights reserved.