Problem with Laravel Mix

Published 1 year ago by joshgallagher24

Hi everyone!

I am using Laravel Mix in a project outside of Laravel - a static website. However, I am having an issue with the config.

I have fonts in a font folder, which I add through a SASS file as shown below:

    font-family: 'Graphik-bold'
    font-weight: 500
    src:  url('../fonts/GraphikSemibold.woff') format('woff')

    font-family: 'Graphik-reg'
    font-weight: 300
    src:  url('../fonts/GraphikReg.woff') format('woff')

Here, in the paths I set "../fonts/GraphikSemibold.woff", however, upon compilation this path is changed to "/fonts/GraphikSemibold.woff".

How do I stop Laravel Mix from changing the file path?

Best Answer (As Selected By joshgallagher24)

The answer is in the documentation:

1 year ago (262,760 XP)

The answer is in the documentation:


I just found it - skipped over it!

For anyone else using Sass with fonts or is having problems with URL rewriting add this:

      processCssUrls: false

Please sign in or create an account to participate in this conversation.