Webpack use existing source map from previous build step
It turns out an extra webpack "preLoader" called source-map-loader does the trick:
$ npm install source-map-loader --save
Then in webpack.config.js
:
module.exports = {
devtool: 'source-map',
module: {
preLoaders: [
{
test: /\.js$/,
loader: 'source-map-loader'
}
]
}
};
Update for Webpack 2+
module.exports = {
devtool: 'source-map',
module: {
rules: [
{
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre"
}
]
}
};