Fix preprocessors not running on stylesheets imported from stylesheets #7950
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, orcomposes:
reported in #7919), Webpack would not run all required loaders over the imported stylesheets. As theimportLoaders
value was still2
, it would runpostcss-loader
andresolve-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.