-
-
Notifications
You must be signed in to change notification settings - Fork 608
Add explanation #1
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
Comments
Sry I'm too dumb to get it. Tried something like this: background-image: url(file!../../bundle/assets/img/bg.jpg); |
background-image: url(../../bundle/assets/img/bg.jpg); And configure it in the webpack options: module.exports = {
module: {
loaders: [
{ test: /\.css$/, loader: "style-loader!css-loader" },
{ test: /\.jpg$/, loader: "url-loader?limit=10000&minetype=image/jpg" }
// or: { test: /\.jpg$/, loader: "file-loader" }
],
}
}; Then: require("./style.css"); For rar cases it also possible to overwrite it in the css: background-image: url(~!file!../../bundle/assets/img/bg.jpg); Generally |
The The |
Ah thx. Great! webpack is awesome 👍
|
Does the url() behaviour also apply on the less-loader? Or should it always be combined with the css-loader? |
The { test: /\.less$/, loader: "style-loader!css-loader!less-loader" }, Check this example config. |
Yep, thx! |
I think the line "You should define useful loaders by config." is still a bit unclear. Would be nice to include some example config that will be passed to webpack. I sought for a way to pass the url-loader a config object. |
Fixed wrong url in README
Hi @sokra :)
how is the url- or file-loader supposed to work with the css-loader?
The text was updated successfully, but these errors were encountered: