When you’re in development, everything is great. But after running gatsby build, your js plugins and fonts are all broken or missing
So to fix this, first run
gatsby clean
Then, go to your gatsby-config.js file, and add the location of a server where you will be accessing the site. You can edit it later, but for testing purposes, add a test site on a hosting location or a wamp folder location or something. Just some server location where you can browse to and test the site.
At the top of the module.exports, add pathPrefix: `/your-location/`,
This would be the folder where you are going to be testing your site…do not include the domain. It needs to be relative to the domain
Save your gatsby-config.js file. Then run:
gatsby build --prefix-paths
And your site will build as normal, but all the files will be correctly pointing where they need to once you upload the contents of the public folder to the https://yourmagicdomain.com/storage/yoursite/ folder
Need rapid website development:
For smaller projects at high speed
-
Adding script tag embed to Gatsby component
Read More -
Get more than 100 queries in GraphQL (I felt stupid)
Read More -
Animate on Scroll (AOS) into Nuxt js
Read More -
WordPress Super-admin hack
Read More -
Add content or ACF field under thumbnail/image gallery in Woocommerce
Read More