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