There are two things you need to do before you deploy your store using your favorite hosting platforms (e.g Netlify, Vercel, GitHub Pages, Cloudflare Pages, etc.):
-
Set all the environment variables in the deployment service you'll use to run the build.
-
Decide if you want to go with static site generation (SSG) or server-side rendering (SSR).
- Add this in addition to other variables in your env:
NEXT_PUBLIC_DATA_FETCHING=ssg
-
Run
npm run export
to create a static optimized production build of your application. -
Copy the folder in
demo-store-core/packages/website/out
to your preferred static hosting.
- Add this in addition to other variables in your env:
NEXT_PUBLIC_DATA_FETCHING=ssr
-
Set the output directory to
demo-store-core/packages/website/.next
. -
Run
npm run build
to create an optimized production build of your application.
<< previous lesson | next lesson >>