Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS pre-processor config does not respect sourceMap flag #13230

Closed
mdziekon opened this issue Jun 12, 2023 · 1 comment
Closed

CSS pre-processor config does not respect sourceMap flag #13230

mdziekon opened this issue Jun 12, 2023 · 1 comment

Comments

@mdziekon
Copy link

mdziekon commented Jun 12, 2023

Describe the bug

In current version of react-scripts (CRA 5.0.1), it seems disabling source maps generation (with GENERATE_SOURCEMAP=false env) is not respected when configuring certain pre-processors (such as sass-loader).
It's quite an easy thing to fix, as it boils down to a hardcoded value of true when setting up the pre-processors config here:
https://github.com/facebook/create-react-app/blob/main/packages/react-scripts/config/webpack.config.js#L188-L193

I'm going to submit a fix for that, but since CRA is essentially "development-dead", I'm pretty sure no one is going to pick that PR up, but it's still worth a try, or to serve as a hotfix for those who forked CRA or use tools like Craco to modify CRA config.

Steps to reproduce

  1. Build your project with GENERATE_SOURCEMAP=false env variable set

Expected behavior

  • No source maps are included

Actual behavior

  • SCSS-related source maps are included
@mdziekon
Copy link
Author

Sorry, my bad, I didn't notice that resolve-url-loader loader requires this flag to be set to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant