Skip to content

Commit

Permalink
Resolve relative paths for preprocessor styles (#5829)
Browse files Browse the repository at this point in the history
preprocessor will output sourceMap by default
then check if sourceMaps are needed on resolve-url-loader

Fixes #4653
  • Loading branch information
Andrew Luca authored and ianschmitz committed Aug 6, 2019
1 parent 066053c commit 914c95e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
18 changes: 13 additions & 5 deletions packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,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;
};
Expand Down
1 change: 1 addition & 0 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 914c95e

Please sign in to comment.