Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Swaz's avatar
Level 20

Is resolve-url-loader needed when using less?

New Laravel projects ship with resolve-url-loader in the package.json file. I tried browsing the Laravel Mix repo and it looks like this is only used when compiling sass, though I'm not 100% sure. I prefer to use less in my projects so I'm wondering if this is needed, or if it can be removed from my projects. Does anyone have any ideas about this?

0 likes
2 replies
Talinon's avatar

Referencing the less documentation @ http://lesscss.org/usage/#command-line-usage-relative-urls

By default URLs are kept as-is (off), 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 rewrite URLs in imported files so that the URL is always relative to the base file that has been passed to Less.

So, I think you'd be fine just using less-loader

Please or to participate in this conversation.