From 3f0de699f0430d9183392dec7c9344cd4f7490f5 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 17 Jul 2020 14:57:48 +0100 Subject: [PATCH] Clean up comments around Webpack modes --- webpack.config.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index ef3af86bdf..23db22890b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -11,16 +11,18 @@ if (!og_image_url) og_image_url = 'https://app.element.io/themes/element/img/log module.exports = (env, argv) => { if (process.env.CI_PACKAGE) { // Don't run minification for CI builds (this is only set for runs on develop) + // We override this via environment variable to avoid duplicating the scripts + // in `package.json` just for a different mode. argv.mode = "development"; } const development = {}; - if (argv.mode !== "production") { + if (argv.mode === "production") { + development['devtool'] = 'nosources-source-map'; + } else { // 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'; - } else { - development['devtool'] = 'nosources-source-map'; } // Resolve the directories for the react-sdk and js-sdk for later use. We resolve these early so we