question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Absolute path for fonts

See original GitHub issue

Hi,

right now Webpack outputs fonts inside the css folder.

screen shot 2017-01-11 at 12 31 10 pm

updating webpack.conf.js from

{
            test: /\.(woff2?|ttf|eot|svg)$/,
            loader: 'file-loader',
            options: {
                name: '/fonts/[name].[ext]?[hash]'
            }
        }

to

name: '../fonts/[name].[ext]?[hash]'

fix the issue

Thanks

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

12reactions
Kristoriescommented, Jun 25, 2018
let mix = require('laravel-mix');

mix.setPublicPath('public');
mix.setResourceRoot('../');
12reactions
bankgtcommented, Dec 5, 2017

@fudgelabs You can use this function for set a path. mix.setPublicPath(‘themes/ilp/assets/dist’); mix.setResourceRoot(‘/themes/ilp/assets/dist/’);

Read more comments on GitHub >

github_iconTop Results From Across the Web

Font-Face use absolute path - css - Stack Overflow
First of all that's relative path and not absolute path, absolute path means using like http://whatever.com/fonts/font_file.woff and ...
Read more >
Absolute path for fonts · Issue #75 · laravel-mix ... - GitHub
The only issue is I too am seeing fonts always being copied to the public root. The only way to get them into...
Read more >
How to use @font-face in CSS
The @font-face rule allows custom fonts to be loaded on a webpage. Once added to a stylesheet, the rule instructs the browser to...
Read more >
src - CSS: Cascading Style Sheets - MDN Web Docs
Specifies the full name or postscript name of a locally-installed font face using the local() function, which uniquely identifies a single font face...
Read more >
Problem with Path in @font-face src: url(...) - General Support
The problem I haven't been able to get the path to the font file right. The actual path to one of the files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found