Make sourcemaps legible by humans

This commit is contained in:
Travis Ralston 2020-01-16 11:47:16 -07:00
parent 69d49f9881
commit bb931e25d8

View File

@ -42,6 +42,10 @@ module.exports = (env, argv) => {
}, },
}, },
// This fixes duplicate files showing up in chrome with sourcemaps enabled.
// See https://github.com/webpack/webpack/issues/7128 for more info.
namedModules: false,
// Minification is normally enabled by default for webpack in production mode, but // Minification is normally enabled by default for webpack in production mode, but
// we use a CSS optimizer too and need to manage it ourselves. // we use a CSS optimizer too and need to manage it ourselves.
minimize: argv.mode === 'production', minimize: argv.mode === 'production',
@ -297,10 +301,9 @@ module.exports = (env, argv) => {
chunkFilename: "bundles/[hash]/[name].js", chunkFilename: "bundles/[hash]/[name].js",
}, },
// DO NOT enable this option. It makes the source maps all wonky. Instead, // This makes the sourcemaps human readable for developers. We use eval-source-map
// we end up including the sourcemaps through the loaders which makes them // because the plain source-map devtool ruins the alignment.
// more accurate. devtool: "eval-source-map",
//devtool: "source-map",
// configuration for the webpack-dev-server // configuration for the webpack-dev-server
devServer: { devServer: {