Vercel are the makers of Next, and the host we most commonly use. Vercel comes with all the CDN support to optimize for Next's various data fetching options, and Github integration to automatic deployment from Git branches.
There are a few configuration settings you'll want to set when using Bubs Next.
These ENV variables need to be set:
WORDPRESS_API_URL
: the hosted wordpress grapqhl endpointNPM_ONLY_PRODUCTION
:1
-- We don't need linters or Husky dependencies
We setup WordPress and Next in a single repository. In order for Vercel to build the site from the website
folder, you'll need to use their monorepo functionality to configure the different Root Directory.
With the Github integration, every commit generates a preview. Those aren't needed on commits outside of website
, which can be setup by configuring the ignored build step to have a value of git diff HEAD^ HEAD --quiet .