fix: fix dev mode css files being processed by asset/resource#42283
Closed
xiaoxiaojx wants to merge 1 commit intovercel:canaryfrom
Closed
fix: fix dev mode css files being processed by asset/resource#42283xiaoxiaojx wants to merge 1 commit intovercel:canaryfrom
xiaoxiaojx wants to merge 1 commit intovercel:canaryfrom
Conversation
e078ebe to
6b863fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Bug
I found a bug in the development environment,As shown in the picture below, the content in the style tag is a url string,not css content.

because styles/globals.css will be processed by stlye-loader first,At this point, the style-loader will require again
The issuer of require in style-loader is styles/globals.css, So it will be processed by asset/resource
I know more about Webpack Rule.oneOf now.

!!xxx/css-loader/src/index.js??xxx/postcss-loader/src/index.js??ruleSet[1].rules[3].oneOf[6].use[2]!./globals.css will not pick any loader, but asset/resource can be merged in, not sure if it's intentional or not