From 62066433d865376c3d8cc298bd211c85b1603141 Mon Sep 17 00:00:00 2001 From: Elena Strizhack Date: Mon, 4 Jun 2018 14:02:34 +0300 Subject: [PATCH] config source map type --- packages/react-scripts/config/webpack.config.prod.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index c267bf011..f41f3ed64 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -31,6 +31,7 @@ const publicPath = paths.servedPath; const shouldUseRelativeAssetPaths = publicPath === './'; // Source maps are resource heavy and can cause out of memory issue for large source files. const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false'; +const sourceMapType = process.env.SOURCEMAP_TYPE; // `publicUrl` is just like `publicPath`, but we will provide it to our app // as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript. // Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz. @@ -64,7 +65,7 @@ module.exports = { bail: true, // We generate sourcemaps in production. This is slow but gives good results. // You can exclude the *.map files from the build during deployment. - devtool: shouldUseSourceMap ? 'source-map' : false, + devtool: shouldUseSourceMap ? (sourceMapType || 'source-map') : false, // In production, we only want to load the polyfills and the app code. entry: [require.resolve('./polyfills'), paths.appIndexJs], output: {