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:
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?
npm install && typings install && npm run dev
-> opened chrome -> F12 -> navigate to localhost:8080/webpack-dev-server (or localhost:8080/build - both works) and I'm seeing a log fromReactDOM.js:66
andapp.tsx:14
, so sourceMaps seem to be working - maybe your issue is to FIRST open the dev-tools before entering the url (or hit F5 after opening the dev-tools) - but your config seems to work. - Running Node v4.2.6 (>=4.x.x is required for Webpack i think)webpack
as well aswebpack-dev-server
- since it is basically the same thing, with the addition of thedev-server
automatically serving the stuff thatwebpack
packaged. - So you can usenpm run build
ornpm run dev
and both will generate a source-map.webpack
and notwebpack-dev-server
:(