-
Notifications
You must be signed in to change notification settings - Fork 696
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
Require a image in CSS #45
Comments
just
You will need to use See https://github.com/nkbt/esnext-quickstart/blob/master/webpack.config.js#L19-L24 for example |
Thanks! This is probably the best how-to guide out there. |
@nkbt is this the same for a img src? because this line: https://github.com/Lar21/webpack-starter-angular/blob/master/src/components/home/home.html#L7 is not working |
@sibelius webpack does not process html files and const imgSrc = require('../../img.jpg');
// ....
// some kind of template
render(`
<img src="%imgSrc%" />
`) in angular you would use scope/this $scope.imgSrc = require('../../img.jpg');
//....
// template.html
<img="imgSrc" /> And so on. Just remember, that webpack simply returns string from |
@nkbt thanks, this works great! \o/ |
I can require a image in JS easily like:
How can I require a image in CSS? I need something like:
The text was updated successfully, but these errors were encountered: