[Vuejs]-Webpack: can't build correct font paths

0πŸ‘

The problem seems to be the relative paths in your url statements.

// ...
url('./#{$font-path}someFont/someFont.woff2') format('woff2'),
// ...

I think you can remove the ./ at the beginning of the url part.


Update 1

Try to use a relative path in your style.

Assuming that your folder structure looks like the following:

.
β”œβ”€β”€ assets
β”‚Β Β  └── fonts
β”‚Β Β      └── font1.woff2
└── src
    └── style
        └── main.scss

Reference your font in your stylesheet with ../../assets/font1.woff2. Which means in your case to also adjust the variable $font-path.

πŸ‘€floriangosse

Leave a comment