From 7914ee8b763daab4fa57ff0731966342b882a45e Mon Sep 17 00:00:00 2001 From: Kiryl Budnik Date: Tue, 7 Nov 2023 19:46:50 +0100 Subject: [PATCH] update webpack configuration with devtool property --- craco.config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/craco.config.js b/craco.config.js index f4477e6d2f..4398b2d0ed 100644 --- a/craco.config.js +++ b/craco.config.js @@ -22,5 +22,17 @@ module.exports = { tsConfigPath: "./tsconfig.paths.json", }, }, + { + plugin: { + overrideWebpackConfig: ({ webpackConfig }) => { + webpackConfig.devtool = + process.env.REACT_APP_ENV === "dev" + ? "source-map" + : "eval-cheap-module-source-map"; + + return webpackConfig; + }, + }, + }, ], };