From 75f980adc68487a0427505c0ccffbba2a7a77809 Mon Sep 17 00:00:00 2001 From: Kiryl Budnik Date: Tue, 14 Nov 2023 09:41:38 +0100 Subject: [PATCH 1/3] update craco configuration to disable source mapping on staging env --- craco.config.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/craco.config.js b/craco.config.js index 4398b2d0ed..5f90400839 100644 --- a/craco.config.js +++ b/craco.config.js @@ -25,10 +25,9 @@ module.exports = { { plugin: { overrideWebpackConfig: ({ webpackConfig }) => { - webpackConfig.devtool = - process.env.REACT_APP_ENV === "dev" - ? "source-map" - : "eval-cheap-module-source-map"; + if (process.env.REACT_APP_ENV === "stage") { + delete webpackConfig.devtool; + } return webpackConfig; }, From f610309d6c1d9423fc5be55811370d2871a40114 Mon Sep 17 00:00:00 2001 From: Andrey Mikhadyuk Date: Tue, 14 Nov 2023 13:32:07 +0300 Subject: [PATCH 2/3] Revert "Disable source mapping in staging" --- craco.config.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/craco.config.js b/craco.config.js index 5f90400839..4398b2d0ed 100644 --- a/craco.config.js +++ b/craco.config.js @@ -25,9 +25,10 @@ module.exports = { { plugin: { overrideWebpackConfig: ({ webpackConfig }) => { - if (process.env.REACT_APP_ENV === "stage") { - delete webpackConfig.devtool; - } + webpackConfig.devtool = + process.env.REACT_APP_ENV === "dev" + ? "source-map" + : "eval-cheap-module-source-map"; return webpackConfig; }, From 28fe5da53eb8fbb3a3702dbb4704e0df47fb1342 Mon Sep 17 00:00:00 2001 From: Kiryl Budnik Date: Tue, 14 Nov 2023 11:57:10 +0100 Subject: [PATCH 3/3] update craco configuration to disable source mapping on prod --- craco.config.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/craco.config.js b/craco.config.js index f4477e6d2f..1a0f6e1601 100644 --- a/craco.config.js +++ b/craco.config.js @@ -22,5 +22,16 @@ module.exports = { tsConfigPath: "./tsconfig.paths.json", }, }, + { + plugin: { + overrideWebpackConfig: ({ webpackConfig }) => { + if (process.env.REACT_APP_ENV === "production") { + delete webpackConfig.devtool; + } + + return webpackConfig; + }, + }, + }, ], };