From 607a298f631134c47eebefdba2d8da86a1a87273 Mon Sep 17 00:00:00 2001 From: Toan Dang Date: Tue, 9 Jan 2024 14:42:46 +0700 Subject: [PATCH] add source map --- config-overrides.js | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/config-overrides.js b/config-overrides.js index ed497e2c1..fac3603ae 100644 --- a/config-overrides.js +++ b/config-overrides.js @@ -51,6 +51,7 @@ const fixBabelRules = (config) => { module.exports = { fallback, webpack: function (config, env) { + const isDevelopment = env === 'development'; fixBabelRules(config); config.resolve.fallback = fallback; @@ -84,26 +85,26 @@ module.exports = { fs.copyFileSync(vendorFileSrc, vendorFileDest); } - // if (!isDevelopment && process.env.SENTRY_AUTH_TOKEN) { - // const SentryWebpackPlugin = require('@sentry/webpack-plugin'); - // config.devtool = 'source-map'; - // config.plugins.push( - // new SentryWebpackPlugin({ - // org: 'oraichain', - // project: 'oraidex', + if (!isDevelopment && process.env.SENTRY_AUTH_TOKEN) { + const SentryWebpackPlugin = require('@sentry/webpack-plugin'); + config.devtool = 'source-map'; + config.plugins.push( + new SentryWebpackPlugin({ + org: 'oraichain', + project: 'oraidex', - // // Specify the directory containing build artifacts - // include: './build', + // Specify the directory containing build artifacts + include: './build', - // // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ - // // and needs the `project:releases` and `org:read` scopes - // authToken: process.env.SENTRY_AUTH_TOKEN, + // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/ + // and needs the `project:releases` and `org:read` scopes + authToken: process.env.SENTRY_AUTH_TOKEN - // // Optionally uncomment the line below to override automatic release name detection - // release: process.env.RELEASE - // }) - // ); - // } + // Optionally uncomment the line below to override automatic release name detection + // release: process.env.RELEASE + }) + ); + } config.plugins.push( new webpack.DllReferencePlugin({