recipes/nuxt
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
| Task | Inserted | Description |
|---|---|---|
deploy:build | — | Overrides the built-in build task and runs nuxt build |
nuxt:generate | — | Runs nuxt generate |
The recipe runs commands from /.
Configuration
| Key | Type | Default | Description |
|---|---|---|---|
shared_files | string[] | ['.env'] | Files symlinked from shared/ into each release |
nuxt_path | string | '' | Sub-path to the Nuxt app within the repository |
source_path | string | '' | Used as the default value for nuxt_path |
typescript
import { set } from '@catapultjs/deploy'
set('nuxt_path', 'apps/web')
import '@catapultjs/deploy/recipes/nuxt'For PM2, use the Nitro server entry from the active release:
javascript
const path = require('path')
const deployPath = '/home/deploy/myapp'
module.exports = {
apps: [
{
name: 'nuxt',
cwd: path.join(deployPath, 'current'),
script: '.output/server/index.mjs',
},
],
}Run the static generation task manually:
bash
npx cata task nuxt:generateFor static Nuxt sites generated locally, use recipes/nuxt_static.