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

Issue with serving static files #326

Closed
jediofthecode opened this issue Nov 22, 2016 · 6 comments
Closed

Issue with serving static files #326

jediofthecode opened this issue Nov 22, 2016 · 6 comments

Comments

@jediofthecode
Copy link

Node version: 6.9.1
npm version: 3.10.8
Operating system: Ubuntu 16.10 AMD64

Steps to reproduce: When serving fonts via the file loaders in src/fonts, they are available to download, and if set with an absolute http url (eg: http://localhost:3030/fonts/fontname.woff in sass they are correctly read, but if I set with an absolute base url(eg: /fonts/fontname.woff) it will not load properly. I am wondering if this is an issue or there are special steps for including fonts in sass files for defining custom font-faces.

@kwelch
Copy link
Collaborator

kwelch commented Nov 22, 2016

Is this from the dev server or production?

If you are intending to use the file loader I recommend referencing the files like the image example on the FAQ page.

@jediofthecode
Copy link
Author

it is from the dev server, and, can I reference files like this within an scss file ?

@davidglbr
Copy link
Contributor

davidglbr commented Nov 25, 2016 via email

@jediofthecode
Copy link
Author

jediofthecode commented Dec 1, 2016

Alright, sorry for the delay, if I reference a font like this in my sass:

@font-face { font-family: 'proxima-reg'; src: url('../fonts/proxima_nova_alt_regular-webfont.woff2') format('woff2'), url('../fonts/proxima_nova_alt_regular-webfont.woff') format('woff'); font-weight: normal; font-style: normal; }

it will not work at first, it shows no font's loading, i get no errors in webpack or in the console. Then i can modify the file to anything, save, and modify it back to exactly this, save and it hotloads, and the font loads...this makes no sense why it is not loading initially.

it also seems that setting this makes it work:

output: { publicPath: 'http://localhost:3030/' }

@davidglbr
Copy link
Contributor

davidglbr commented Dec 1, 2016 via email

@kwelch
Copy link
Collaborator

kwelch commented Feb 3, 2017

I put in #207 which dynamically set the publichPath which should resolve this.

If I read your last comment it appears you got it working. If not feel free to re-open.

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