Closed saskodh closed 7 years ago
@saskodh what is the benefit of using resolve-url-loader
after less-loader
?
less-loader
passes the --relative-urls
option to less
. From the docs:
By default URLs are kept as-is, so if you import a file in a sub-directory that references an image, exactly the same URL will be output in the css. This option allows you to re-write URL's in imported files so that the URL is always relative to the base imported file.
Isn't this exactly what is the purpose of resolve-url-loader
and therefore redundant because less
already did it?
@SebastianS90 yes, you are right. Thanks for pointing this out! I didn't know that the less pre-processor is doing that and somehow I didn't noticed it at first. However this loader still helped in few cases (source urls from this version of bootstrap written as string weren't rewritten by the less-loader).
Sorry @saskodh but this has been trumped by a breaking change in the sass-loader
. I am sorry that you will not get contributor credit.
Could you please let me know if #45 will fix your issue.
Use npm i resolve-url-loader@bholloway/resolve-url-loader#feature/support-sass-loader-6
Hi, thanks for writing this loader, it helps me a lot in the migration of older project with Grunt build to Webpack. I tried to use it after a less-loader and it was failing with error 'Source map not available'. After some debugging I noticed that the source map from the less-loader comes as string while in the code it's expected as object. So simple JSON.parse did the job. :)
Cheers!