From fb9503199dcf682493b29feda74f9455c497b52a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 16 Jan 2020 11:55:54 -0700 Subject: [PATCH] Don't calculate sourcemaps in production --- webpack.config.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 28d0bfea..255f0ce2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -14,7 +14,16 @@ module.exports = (env, argv) => { argv.mode = "development"; } + const development = {}; + if (argv.mode !== "production") { + // This makes the sourcemaps human readable for developers. We use eval-source-map + // because the plain source-map devtool ruins the alignment. + development['devtool'] = 'eval-source-map'; + } + return { + ...development, + entry: { "bundle": "./src/vector/index.js", "indexeddb-worker": "./src/vector/indexeddb-worker.js", @@ -301,10 +310,6 @@ module.exports = (env, argv) => { chunkFilename: "bundles/[hash]/[name].js", }, - // This makes the sourcemaps human readable for developers. We use eval-source-map - // because the plain source-map devtool ruins the alignment. - devtool: "eval-source-map", - // configuration for the webpack-dev-server devServer: { // serve unwebpacked assets from webapp.