aizu's Knowledge Base
    • Go to: aizu.my Homepage
    • Recent
    • Tags
    • Register
    • Login

    PM2 - Sveltekit ecosystem

    Linux
    1
    2
    148
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      aizu
      last edited by aizu

      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",
            },
          },
        ],
      };
      
      1 Reply Last reply Reply Quote 0
      • A
        aizu
        last edited by aizu

        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.

        Ref: https://kit.svelte.dev/docs/adapter-node

        1 Reply Last reply Reply Quote 0
        • First post
          Last post