wmock
wmock

Reputation: 5492

Missing sourcemaps in Typescript + Webpack project

I've created a Github repo that has all the source code related to this question. I'm able to load build/index.html in the browser after running npm install. However, when I view the sources tab in Chrome, I don't see the source maps associated with the .tsx files.

Here's a screenshot of what I see: no-source-map

I've added sourceMap: true in my tsconfig.json as well as debug: true and devtool: "source-map" in my webpack.config.json. Any thoughts on what I'm missing here?

EDIT:

This might be a silly question, but do you have to use webpack-dev-server in order to see the sourcemaps?

Upvotes: 14

Views: 5211

Answers (2)

Nicklas Pouey-Winger
Nicklas Pouey-Winger

Reputation: 3023

I had to add a filepath for the sourcemap file. Take a look at the output part of this webpack.config.js: https://github.com/nwinger/reactreduxtodo/blob/master/webpack.config.js

Upvotes: 1

Matthias
Matthias

Reputation: 928

Your tsconfig.json might be well.

Try in your webpack.config.js either devtool: "inline-source-map" or remove the two options od debug and devtool complete. In my case I don't need them.

Upvotes: 4

Related Questions