Enables HMR fast-rebuild (for NodeJS) with inline eval sourcemaps, while preserving stacktraces
npm install webpack-hmr-sourcemapsdevtool: 'source-map' or equivalent => takes a long time to recompile (when watching changes)
devtool: 'eval-source-maps' or equivalent => broken stacktraces, wrong files in maps.
const webpack = require('webpack');
const HmrEvalSourceMapDevToolPlugin = require('webpack-hmr-sourcemaps');
module.exports = {
// [...]
devtool: prod ? 'source-map' : false,
plugins: [
...prod ? [] : [
new webpack.HotModuleReplacementPlugin(),
new HmrEvalSourceMapDevToolPlugin({
columns: true,
module: true,
})
],
]
}
``