diff --git a/craco.config.js b/craco.config.js index f4477e6d2..25f108665 100644 --- a/craco.config.js +++ b/craco.config.js @@ -1,6 +1,17 @@ const CracoAlias = require("craco-alias"); module.exports = { + webpack: { + configure: (webpackConfig, { env, paths }) => { + const reactAppEnv = process.env.REACT_APP_ENV; + if (reactAppEnv === "dev" || reactAppEnv === "stage") { + webpackConfig.devtool = "source-map"; + } else { + webpackConfig.devtool = false; + } + return webpackConfig; + }, + }, style: { css: { loaderOptions: () => ({ diff --git a/tsconfig.json b/tsconfig.json index d875ebb0f..19e07ee1b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "sourceMap": true, "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true,