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

Fix preprocessors not running on stylesheets imported from stylesheets #7950

Closed
wants to merge 1 commit into from

Conversation

joshhunt
Copy link

@joshhunt joshhunt commented Nov 8, 2019

Fixes #7919 and fixes #7777

An extra loader to preprocessed CSS files was introduced in 914c95e#diff-dc0c4e7c623b73660da1809fc60cf6ba, but the importLoaders option was not updated to account for this.

This meant that when a stylesheet was imported from another stylesheet (like when using . @import as reported in #7777, or composes: reported in #7919), Webpack would not run all required loaders over the imported stylesheets. As the importLoaders value was still 2, it would run postcss-loader and resolve-url-loader but most importantly, it incorrectly skipped the preProcessor,

I fixed the issue here, and added a small comment warning future developers about this, as seen elsewhere in the webpack config.

I verified this change by running it over my reproduction case mention in #7919.

@joshhunt joshhunt changed the title Increment importLoaders preprocessor rules, fixes #7919 Increment importLoaders for css preprocessor rules, fixes #7919 Nov 8, 2019
@joshhunt joshhunt changed the title Increment importLoaders for css preprocessor rules, fixes #7919 Fix preprocessors not running on stylesheets imported from stylesheets Nov 11, 2019
@joshhunt
Copy link
Author

joshhunt commented Dec 9, 2019

This issue is still present with create-react-app v3.3.0, and this PR still fixes it 😃

@Mati365
Copy link

Mati365 commented Jan 2, 2020

Any changes?

@ianschmitz ianschmitz modified the milestones: 3.3.1, 3.4 Jan 31, 2020
@Dakkers
Copy link

Dakkers commented Jan 31, 2020

@joshhunt this looks like it's been fixed in 3.3.1 via #8281

@ianschmitz
Copy link
Contributor

Ah apologies, I didn't see this PR. Yes it's been fixed already in 3.3.1

@ianschmitz ianschmitz closed this Jan 31, 2020
@lock lock bot locked and limited conversation to collaborators Feb 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants