项目配置
增加配置文件
ecosystem.config.js
module.exports = {
apps: [
{
name: '项目名称', // 项目名称
port: '3001', // 端口号(自定义,不为8080)
exec_mode: 'cluster',
instances: 'max',
script: './.output/server/index.mjs'
}
]
}
Nuxt.config.ts
export default defineNuxtConfig({ ssr: false })
打包
npx nuxt build 或 npm run build
dist.zip
将打包出来的.output文件与ecosystem.config.js一起压缩即可