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
Initial work towards native css support #14894
Conversation
For maintainers only:
|
70cc319
to
ae05117
Compare
CSS allow to write div {
background: url('./img\
\
\
\
-other-part.png');
} We normalize it in Here example of most of all Also CSS allows to have interesting things in div {
background: url(./img\'img.png);
background: url("./img%27%27%27img.png");
} Test case for Also CSS allow to do circular imports (they just ignored because already loaded): file.css @import "file.css"; |
Thanks. I'll add these as tests. Some of them are a bit weird: |
And I found another fancy thing in the spec: background-image: image('sprites.svg#xywh=40,0,20,20', black) https://developer.mozilla.org/en-US/docs/Web/CSS/image/image() |
ae05117
to
bab5563
Compare
Yep, but in real world I have not seen anyone use this, |
* @param {Hash} hash hash that will be modified | ||
* @param {UpdateHashContext} updateHashContext context for updating hash | ||
*/ | ||
updateHash(hash, { module }) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we do here same as #14857
? Template.asString([ | ||
"if (link.src.indexOf(window.location.origin + '/') !== 0) {", | ||
Template.indent( | ||
`link.crossOrigin = ${JSON.stringify(crossOriginLoading)};` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting small improvement #10064 (comment) possible here
return pos; | ||
}; | ||
walkCssTokens(source, { | ||
url: (input, start, end, contentStart, contentEnd) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we need a hooks here (at least in webpack@6)
emit warnings even when output is cached
I've created an issue to document this in webpack/webpack.js.org. |
What kind of change does this PR introduce?
experiment
Did you add tests for your changes?
yes
Does this PR introduce a breaking change?
no
What needs to be documented once your changes are merged?
experiments.css: true
enables css support. See Native CSS support #14893 for progress and documentation.