diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 771b06c94d1..7d61006cdc6 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -121,12 +121,20 @@ module.exports = function(webpackEnv) { }, ].filter(Boolean); if (preProcessor) { - loaders.push({ - loader: require.resolve(preProcessor), - options: { - sourceMap: isEnvProduction && shouldUseSourceMap, + loaders.push( + { + loader: require.resolve('resolve-url-loader'), + options: { + sourceMap: isEnvProduction && shouldUseSourceMap, + }, }, - }); + { + loader: require.resolve(preProcessor), + options: { + sourceMap: true, + }, + } + ); } return loaders; }; diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index af92d8ab28b..d657d392986 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -70,6 +70,7 @@ "react-app-polyfill": "^1.0.1", "react-dev-utils": "^9.0.1", "resolve": "1.10.0", + "resolve-url-loader": "3.0.1", "sass-loader": "7.1.0", "semver": "6.0.0", "style-loader": "0.23.1",