Laravel-mix: Fonts relative paths are changed when compiled

Created on 13 Apr 2017  路  2Comments  路  Source: JeffreyWay/laravel-mix

Hello,

I have a theme which I have included from node_modules, I am using LESS.

When I'm compiling my style.less file, I found out that the relative path of the fonts in the less files are changed

Here's an example of font-awesome

Less file from node_modules :

image

Compiled CSS

image

I have no idea where it's getting icons/font-awesome when compiled, when it should have been ../ as it was originally before compilation.

Any ideas what caused this?

Most helpful comment

Yes, this is normal behaviour.
You can turn off this and copy fonts files via copy() method.

mix. sass ('src/app.scss' , 'dist/' )
.options ({
processCssUrls : false
});

This should work for less as well.

Read more:
https://github.com/JeffreyWay/laravel-mix/blob/master/docs/css-preprocessors.md

All 2 comments

p sure this is just normal webpack behavior

it's been covered here a few times iirc

Yes, this is normal behaviour.
You can turn off this and copy fonts files via copy() method.

mix. sass ('src/app.scss' , 'dist/' )
.options ({
processCssUrls : false
});

This should work for less as well.

Read more:
https://github.com/JeffreyWay/laravel-mix/blob/master/docs/css-preprocessors.md

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jpriceonline picture jpriceonline  路  3Comments

Micaso picture Micaso  路  3Comments

rderimay picture rderimay  路  3Comments

stefensuhat picture stefensuhat  路  3Comments

RomainGoncalves picture RomainGoncalves  路  3Comments