I’ve moved this blog from Gatsby.js to Hugo. My build times have gone down from more than 7 minutes to a few seconds! The slow build times with Gatsby have been an ongoing concern for me. I’ve slowly been creeping towards Netlify’s free 300-minutes-build-time cap. Hugo runs a magnitude faster, and it integrates well with Netlify. Hugo is a static site generator built with Golang. The project’s selling points are incredible speed, ease of use, and the ability to configure tons of settings.
I wrote about my Gatsby build time woes yesterday. Unfortunately, Netlify and Gatsby rebuild my site completely with every update. I use the gatsby-plugin-netlify-cache but build times are still high. While searching for ways to optimize my Netlify build I stumbled upon an issue on the Gatsby repository. The issue was merged into master and published to email@example.com. Before: At the moment this hash changes if anything within ./src has changed between builds.
The official Hugo Docs do a very good job at guiding you through the installation of Hugo, the static site generator written in Golang. Setting up a local version of Hugo turned out to be a smooth experience (on Manjaro Linux/Arch Linux). But as always, hosting and deployment can throw a wrench into the works. My landing page website is built with Hugo Extended 0.54, ships to a private Gitlab repo and automatically deploys to Netlify, a hosting provider with tons of other features (free SSL certificates, automatic deployments, CDN, etc.
Yesterday I was working on my portfolio site. A local copy of Hugo, the static site generator written in Golang, worked fine on my machine. But when I tried to deploy the site to Netlify, the builds failed with an error: failed to transform resource: TOCSS: failed to transform "css/main.tmp.css" (text/x-sass): this feature is not available in your current Hugo version The reason? My website template uses Sass and PostCSS. This only works with the extended version of Hugo.