-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
feat: add support to css url #279
base: master
Are you sure you want to change the base?
Conversation
sources.push({ startIndex, value: urlSource, unquoted }); | ||
}); | ||
return; | ||
} |
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.
Very bad idea, we should use css-loader
for that:
- Introduce new attribute type:
type: src | srcset | style
- Run
css-loader
forstyle
- Stringify result
Ideally we should have two tests:
- only css-loader
- css-loader +postcss-loader, it is allow to autoprefixing in
style
attribute
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.
@evilebottnawi I couldn't find a way to run css-loader on a string
all I can think about doing is to export style content to temporary file tmp.css and then find a way to run webpack with css-loader on that file, this will make html-loader
depend on css-loader
and webpack
.
Is there a way to run css-loader only on a string ?
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.
This is where we should think. In theory we should create virtual module. Maybe we right now we can use css-loader.call(content)
, maybe we need more options/API for that.
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.
I need time to think about it.
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.
Also please avoid prettier changes, we will do it in the other PR
any update? or some solution for |
This PR contains a:
Motivation / Use-Case
add support for
url
in css : #259background: url(image.png)
=>background-image:url(/webpack/public/path/image.png)
Breaking Changes
No
Additional Info