I was learning about css-loader in webpack, the defination says that
The css-loader interprets @import
and url()
like import/require()
and will resolve them. What does it mean, In an example in the documentaion there is
url(image.png) => require('./image.png')
So my question is will it convert url('./image.png')
to require('image.png')
For example in a css file if i have background property as
#selector{
background:url('./image.png'); //this is a vlid css property
}
will the above style converted like
#selector{
background:require('./image.png'); // this is not a valid css property
}
if this is how the conversion take place than background:require('./image.png')
is not valid css,
is there something wrong in my understanding, may be i'm not getting what css-loader does actually. I went through the documentation of css-loader.
can anyone explain where i am wrong.