PM2 - Sveltekit ecosystem
-
ecosystem.config.cjs
module.exports = { apps: [ { name: 'name_app', script: './build/index.js', watch: false, // ignore_watch: ['database'], autorestart: true, env: { PORT: 3000, ENV_PATH: "./.env.local", } } ] };
Run in preview mode
module.exports = { apps: [ { name: "sirehpark-www", script: "npm", args: "run preview", cwd: "/var/www/sirehpark", env: { E_ENV: "production", }, }, ], };
-
NodeJS Build
npm i -D @sveltejs/adapter-node
File: svelte.config.js
import adapter from '@sveltejs/adapter-node';
Then
# npm run build
The output files will in "./build" directory.