You can use source maps to keep the mapping between source code and related / reduced.
Webpack provides the devtool option to improve debugging in the developer tool by simply creating the source map of the linked file for you. This option can be used from the command line or used in the webpack.config.js configuration file.
Below you can find a far-fetched example using the command line to create a linked file (bundle.js) along with the generated source map file (bundle.js.map).
$ webpack --devtool source-map ./entry.js bundle.js Hash: b13b8d9e3292806f8563 Version: webpack 1.12.2 Time: 90ms Asset Size Chunks Chunk Names bundle.js 1.74 kB 0 [emitted] main bundle.js.map 1.89 kB 0 [emitted] main [0] ./entry.js 85 bytes {0} [built] [1] ./hello.js 59 bytes {0} [built]
index.html
<html> <head> <meta charset="utf-8"> </head> <body> <script src="bundle.js"></script> </body> </html>
entry.js
var hello = require('./hello.js'); document.body.innerHTML += 'It works ' + hello();
hello.js
module.exports = function () { return 'Hello world!'; };
If you open index.html in your browser (I use Chrome, but I think that it is also supported in other browsers), you will see on the Sources tab that you have a linked file according to the file: // scheme and the source files according to a special scheme webpack: //.

And yes, you can start debugging as if you had the source code! Try putting a breakpoint on one line and refresh the page.

dreyescat Oct 29 '15 at 19:11 2015-10-29 19:11
source share