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

nezaboravi picture nezaboravi  路  3Comments

jpmurray picture jpmurray  路  3Comments

stefensuhat picture stefensuhat  路  3Comments

rlewkowicz picture rlewkowicz  路  3Comments

sdebacker picture sdebacker  路  3Comments