Problem with Laravel Mix

Published 3 months 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-face 
    font-family: 'Graphik-bold'
    font-weight: 500
    src:  url('../fonts/GraphikSemibold.woff') format('woff')

@font-face 
    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)
SaeedPrez

The answer is in the documentation:

SaeedPrez

The answer is in the documentation:

joshgallagher24

I just found it - skipped over it!

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

   .options({
      processCssUrls: false
   });

Sign In or create a forum account to participate in this discussion.