Skip to content

Commit bb931e2

Browse files
committed
Make sourcemaps legible by humans
1 parent 69d49f9 commit bb931e2

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎webpack.config.js‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ module.exports = (env, argv) => {
4242
},
4343
},
4444

45+
// This fixes duplicate files showing up in chrome with sourcemaps enabled.
46+
// See https://github.com/webpack/webpack/issues/7128 for more info.
47+
namedModules: false,
48+
4549
// Minification is normally enabled by default for webpack in production mode, but
4650
// we use a CSS optimizer too and need to manage it ourselves.
4751
minimize: argv.mode === 'production',
@@ -297,10 +301,9 @@ module.exports = (env, argv) => {
297301
chunkFilename: "bundles/[hash]/[name].js",
298302
},
299303

300-
// DO NOT enable this option. It makes the source maps all wonky. Instead,
301-
// we end up including the sourcemaps through the loaders which makes them
302-
// more accurate.
303-
//devtool: "source-map",
304+
// This makes the sourcemaps human readable for developers. We use eval-source-map
305+
// because the plain source-map devtool ruins the alignment.
306+
devtool: "eval-source-map",
304307

305308
// configuration for the webpack-dev-server
306309
devServer: {

0 commit comments

Comments
 (0)