Laravel-mix: Preprend domain to CSS URLs

Created on 14 Apr 2017  路  3Comments  路  Source: JeffreyWay/laravel-mix

Is there a way to add a configurable domain to URLs in Sass, so turning this:

.foo { background-image: url('/images/bar.png'); }

Into this:

.foo { background-image: url('https://example.com/images/bar.png'); }

Not sure if this is the right place to ask questions like this.

Most helpful comment

Yes, you can use mix.setResourceRoot().

mix.setResourceRoot('http://example.com/');

All 3 comments

Yes, you can use mix.setResourceRoot().

mix.setResourceRoot('http://example.com/');

Thanks @JeffreyWay!

Thanks @tillkruss @JeffreyWay :+1: I really needed that

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jpriceonline picture jpriceonline  路  3Comments

amin101 picture amin101  路  3Comments

Cheddam picture Cheddam  路  3Comments

rderimay picture rderimay  路  3Comments

mementoneli picture mementoneli  路  3Comments