Skip to content

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

Closed
@mdziekon

Description

@mdziekon

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions