Skip to content

Commit

Permalink
fix: add production export condition to commands
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Oct 20, 2022
1 parent 400c176 commit 6ec410c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/1.guide/1.introduction/0.getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.deploy/1.node.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.deploy/providers/heroku.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
```
2 changes: 1 addition & 1 deletion docs/content/2.deploy/providers/render.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion src/presets/node-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]'
}
})
2 changes: 1 addition & 1 deletion src/presets/node-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
})

Expand Down

0 comments on commit 6ec410c

Please sign in to comment.