diff --git a/README.md b/README.md index 2c63f161ed..c9dc209846 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ npx nitropack build 4️⃣ Output is in the `.output` directory and ready to be deployed on almost any VPS with no dependencies. You can locally try it too: ```bash -node .output/server/index.mjs +node -C production .output/server/index.mjs ``` That's it you got it! Read the [documentation](https://nitro.unjs.io) to learn more. diff --git a/docs/content/1.guide/1.introduction/0.getting-started.md b/docs/content/1.guide/1.introduction/0.getting-started.md index 9acaeb6fe6..dd9e91d7a3 100644 --- a/docs/content/1.guide/1.introduction/0.getting-started.md +++ b/docs/content/1.guide/1.introduction/0.getting-started.md @@ -38,7 +38,7 @@ npx nitropack build Output is in the `.output` directory and ready to be deployed on almost any VPS with no dependencies. You can locally try it too: ```bash -node .output/server/index.mjs +node -C production .output/server/index.mjs ``` You can add `nitropack` using your package manager now: diff --git a/docs/content/2.deploy/1.node.md b/docs/content/2.deploy/1.node.md index f1a023a8bb..30488dc959 100644 --- a/docs/content/2.deploy/1.node.md +++ b/docs/content/2.deploy/1.node.md @@ -23,7 +23,7 @@ nitro build When running `nitro build` with the Node server preset, the result will be an entry point that launches a ready-to-run Node server. To try output: ```bash -$ node .output/server/index.mjs +$ node -C production .output/server/index.mjs Listening on http://localhost:3000 ``` diff --git a/docs/content/2.deploy/providers/heroku.md b/docs/content/2.deploy/providers/heroku.md index 0f9a38b082..e2e0b25a4a 100644 --- a/docs/content/2.deploy/providers/heroku.md +++ b/docs/content/2.deploy/providers/heroku.md @@ -32,6 +32,6 @@ Nitro supports deploying on [Heroku](https://heroku.com/) with minimal configura ```json5 "scripts": { "build": "nitro build", // or `nuxt build` if using nuxt - "start": "node .output/server/index.mjs" + "start": "node -C production .output/server/index.mjs" } ``` diff --git a/docs/content/2.deploy/providers/render.md b/docs/content/2.deploy/providers/render.md index 1bfcac06f9..a47dd7759f 100644 --- a/docs/content/2.deploy/providers/render.md +++ b/docs/content/2.deploy/providers/render.md @@ -15,7 +15,7 @@ Nitro supports deploying on [Render](https://render.com/) with minimal configura 1. Depending on your package manager, set the build command to `yarn && yarn build`, `npm install && npm run build`, or `pnpm i --shamefully-hoist && pnpm build`. -1. Update the start command to `node .output/server/index.mjs` +1. Update the start command to `node -C production .output/server/index.mjs` 1. Click 'Advanced' and add an environment variable with `NITRO_PRESET` set to `render-com`. diff --git a/src/presets/node-cli.ts b/src/presets/node-cli.ts index 0ace277903..5812cfa011 100644 --- a/src/presets/node-cli.ts +++ b/src/presets/node-cli.ts @@ -4,6 +4,6 @@ export const cli = defineNitroPreset({ extends: 'node', entry: '#internal/nitro/entries/cli', commands: { - preview: 'Run with node ./server/index.mjs [route]' + preview: 'Run with node -C production ./server/index.mjs [route]' } }) diff --git a/src/presets/node-server.ts b/src/presets/node-server.ts index d88b83e9b8..32e03240b5 100644 --- a/src/presets/node-server.ts +++ b/src/presets/node-server.ts @@ -5,7 +5,7 @@ export const nodeServer = defineNitroPreset({ entry: '#internal/nitro/entries/node-server', serveStatic: true, commands: { - preview: 'node ./server/index.mjs' + preview: 'node -C production ./server/index.mjs' } })