Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fonts not showing up on development server #20

Open
carmouche opened this issue Jul 12, 2016 · 2 comments
Open

Fonts not showing up on development server #20

carmouche opened this issue Jul 12, 2016 · 2 comments

Comments

@carmouche
Copy link

Hello,

I realized while using this boilerplate that I couldn't get the fonts to work correctly when running the webpack dev server. The demo doesn't seem to be rendering the Open Sans font. I haven't checked if the fonts are working in the production build. I played around with the config and using different paths but couldn't get it working :( Maybe you can help!!

Thanks!

@ifranke
Copy link

ifranke commented Aug 10, 2016

Same issue. As previous posted a guess, the problem is the ''url(./path-to-hashed-font)" in Font-Face definition. Solved in first try by changing the loader for .woff to file-loader and force the output in webpack def to "http:/localhost:". Problem is the url-loader which creates relative urls and with the style-loader your resulting .css with your font-face url is in a blob where the font-file naturally is not included...

Really ugly hack for dev only.

So in short:

output: {
path: PATHS.build,
filename: 'js/bundle.js',
publicPath: 'http://localhost:3001/' // development only
},
...

module: {
loaders: [
...
{
test: /.woff2?(?v=[0-9].[0-9].[0-9])?$/,
//loader: 'url-loader?limit=10000&name=[name]-[hash].[ext]&mimetype=application/font-woff'
loader: 'file-loader'
},
...

Issue should be also solved, if you use extract-text-webpack-plugin as demonstrated for production build, but I do not know which issues you will have in hot reloading if you change this in dev...

@rflmyk
Copy link

rflmyk commented May 20, 2018

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants