From 28fe5da53eb8fbb3a3702dbb4704e0df47fb1342 Mon Sep 17 00:00:00 2001 From: Kiryl Budnik Date: Tue, 14 Nov 2023 11:57:10 +0100 Subject: [PATCH] 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; + }, + }, + }, ], };