I am finishing a Gatsby-ified version of my personal website (http://emilyaviva.github.io/eakm-website-gatsby) and a sticking point seems to be that when the source (http://github.com/emilyaviva/eakm-website-gatsby) is run normally in develop mode, the font-awesome fonts get included, but when it is actually built, the font-awesome fonts don't make it in, somehow. My guess is this has to do with the Webpack loader config, but I'm not sure how. Any ideas?
TBH, I haven't tried loading fonts with Gatsby. Someone else contributed the font webpack config here https://github.com/gatsbyjs/gatsby/blob/aeccf948ebe4470582e109dbfd5f6f1eb152e35b/lib/utils/webpack.config.js#L255-L258
It is setup to run the same though in both develop and production.
It worked fine once I built it with NODE_ENV=production. All I've done, in my index.js, is import 'font-awesome/scss/font-awesome.scss', which uses the built-in Sass loader. I haven't needed to mess with custom loaders for woff, ttf, etc. files.
I like it when things Just Workâ„¢! :)
Mmmm... I've heard people say this before and it just occurred to me why. We autoset NODE_ENV=production on gatsby build in the Webpack build but that only applies to _inside_ Webpack e.g. the React.js code and _not_ to stuff outside of the Webpack context e.g. Webpack loaders. I don't have time to throughly investigate this right now but I'm guessing that's the problem and the solution would be to set process.env.NODE_ENV = 'production' on startup when running gatsby build. I'm going to re-open this issue and change the title.
@emilyaviva this is going out in a new release in a sec. Would be very appreciative if you could upgrade and see if the issue is in fact resolved.
I think this does it! Thanks Kyle, you have been rockin' today 🚀
:D thanks!
On Tue, Jul 5, 2016 at 8:37 PM Ivan Storck [email protected] wrote:
I think this does it! Thanks Kyle, you have been rockin' today 🚀
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/gatsbyjs/gatsby/issues/337#issuecomment-230663566,
or mute the thread
https://github.com/notifications/unsubscribe/AAEVh9TAPu5KZDfAzjaXy_NLNVEVXmP9ks5qSyMLgaJpZM4I4t0k
.
fixz0r3d!
💯
On Tue, Jul 5, 2016 at 9:58 PM Emily Aviva Kapor-Mater <
[email protected]> wrote:
fixz0r3d!
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/gatsbyjs/gatsby/issues/337#issuecomment-230671220,
or mute the thread
https://github.com/notifications/unsubscribe/AAEVh8WyFvGoWANoS9Td2w3ioUxBYdtoks5qSzYBgaJpZM4I4t0k
.
Most helpful comment
@emilyaviva this is going out in a new release in a sec. Would be very appreciative if you could upgrade and see if the issue is in fact resolved.