Check out the Complete guide to Nuxt and Prepr to learn more.
Make sure to install the dependencies:
# npm
npm install
# pnpm
pnpm install
# yarn
yarn installCopy the .env.example file in this directory to .env (which will be ignored by Git) by running the following command:
cp .env.example .envIn the .env file, replace <YOUR_PREPR_GRAPHQL_URL> with the API URL of the Prepr GraphQL Preview access token from your Acme Lease Demo environment.
npm run codegen (also run automatically as part of npm run build) regenerates the GraphQL types in app/gql/ from this schema, reading NUXT_PREPR_GRAPHQL_URL from .env.
Set NUXT_PREPR_ENV=preview to show the Prepr preview toolbar (and let query params override segments/variants); set it to production to hide the toolbar and lock the page down to production content. Both variables are Nuxt runtime config overrides, so in a deployed environment set them on the host at runtime — they're server-only and never baked into the build.
typescriptis pinned to^6becausevue-tscdoesn't yet support TypeScript 7 — bumping it without also bumpingvue-tscwill breaknpm run typecheck.
Start the development server on http://localhost:3000
npm run devBuild the application for production:
npm run buildStart the production build:
npm run startThis runs node --env-file-if-exists=.env .output/server/index.mjs, which serves the app with Nitro's Node.js preset and loads .env if one is present (host-provided environment variables still take precedence).
Check out the deployment documentation for more information.
The Prepr Toolkit's Nuxt middleware needs Nitro's Node.js runtime (the default). Deploying to an edge runtime such as Cloudflare Workers is not supported.
