Skip to content

recipes/nuxt

View source on GitHub

typescript
import '@catapultjs/deploy/recipes/nuxt'

This recipe runs the Nuxt build and generate tasks on the server. It does not override deploy:update_code, so combine it with a transfer recipe such as git or rsync.

See the example Nuxt project for a complete setup, or go directly to deploy.ts.

Tasks

TaskInsertedDescription
deploy:buildOverrides the built-in build task and runs nuxt build
nuxt:generateRuns nuxt generate

The recipe runs commands from /.

Configuration

KeyTypeDefaultDescription
shared_filesstring[]['.env']Files symlinked from shared/ into each release
nuxt_pathstring''Sub-path to the Nuxt app within the repository
source_pathstring''Used as the default value for nuxt_path
typescript
import { set } from '@catapultjs/deploy'
import '@catapultjs/deploy/recipes/nuxt'

set('nuxt_path', 'apps/web')

Run the static generation task manually:

bash
npx cata task nuxt:generate

If you want to generate a static Nuxt site locally and deploy the generated files, follow the static deployment example.