Nuxt/docs/content/3.api/5.commands/dev.md
Yaël Guilloux dc47c64f14
docs: use nuxt 3 and website theme (#5479)
Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
Co-authored-by: Pooya Parsa <pooya@pi0.io>
Co-authored-by: pooya parsa <pyapar@gmail.com>
Co-authored-by: Clément Ollivier <clement.o2p@gmail.com>
2022-10-06 11:15:30 +02:00

34 lines
1.4 KiB
Markdown

---
title: "nuxi dev"
description: The dev command starts a development server with hot module replacement at http://localhost:3000
---
# `nuxi dev`
```{bash}
npx nuxi dev [rootDir] [--dotenv] [--clipboard] [--open, -o] [--no-clear] [--port, -p] [--host, -h] [--https] [--ssl-cert] [--ssl-key]
```
The `dev` command starts a development server with hot module replacement at [http://localhost:3000](https://localhost:3000)
Option | Default | Description
-------------------------|-----------------|------------------
`rootDir` | `.` | The root directory of the application to serve.
`--dotenv` | `.` | Point to another `.env` file to load, **relative** to the root directory.
`--clipboard` | `false` | Copy URL to clipboard.
`--open, -o` | `false` | Open URL in browser.
`--no-clear` | `false` | Does not clear the console after startup.
`--port, -p` | `3000` | Port to listen.
`--host, -h` | `localhost` | Hostname of the server.
`--https` | `false` | Listen with `https` protocol with a self-signed certificate by default.
`--ssl-cert` |`null` | Specify a certificate for https.
`--ssl-key` |`null` | Specify the key for the https certificate.
The port and host can also be set via NUXT_PORT, PORT, NUXT_HOST or HOST environment variables.
This command sets `process.env.NODE_ENV` to `development`.
::alert{type="info"}
If you are using a self-signed certificate in development, you will need to set `NODE_TLS_REJECT_UNAUTHORIZED=0` in your environment.
::