I use babel-loader, but can\'t figure out how to generate or where find source maps for transpiled files. I tried eval-source-map, inline-source-map
Use webpack -d
The d flag stands for development shortcut and it enables all of your developer tools such as source maps.
Add {devtool:"source-map"} to your webpack.config.js
See more here
Use webpack-dev-server -d
-d is shorthand for --debug --devtool source-map --output-pathinfo.output-pathinfo adds comments to the generated bundle that explain what module/files are included in what places. So in the generated code, the comment is added to this line of code: require(/* ./test */23) which says that 23 is pointing to the test module. This is mostly helpful when you're looking at the code Webpack has generated, and not so much when stepping through the debugger. I got this example from this relevant bit of documentation.
This all works because webpack-dev-server accepts all the same flags as webpack.
--content-base - by default the dev server will serve files in the directory you run the command in. If your build files are in build/, you need to specify --content-base build/ so the dev server will serve up files in the build directory--inline - auto-reload whenever you save a file with some changes!All I did is change:
// package.json
{
...
**from** "dev:serve": "webpack-dev-server",
**to** "dev:serve": "webpack-dev-server -d",
...
}
Equivalent to: $ webpack-dev-server -d
Now I can utilize Ctrl + p in Chrome and I see my ES6 syntax to set breakpoints on.
Info
$ webpack-dev-server --version
webpack-dev-server 2.9.7
webpack 3.10.0
Please add in you webpack.config.js file the following`
devtool: "#inline-source-map",
You can find clear information about it from the site of webpack` https://webpack.github.io/docs/configuration.html
Also please find attached screenshot of sourcemap part, from webpack site.
