preview
nx preview my-appRuns astro preview for the project until you stop it. The preview target depends on build, so the site is built first. The target is not cached.
Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
port |
number | none | Port of the server. Without it Astro uses server.port of its config, otherwise 4321. |
host |
string | boolean | none | Network address to listen on; true listens on all addresses. Without it Astro listens on localhost. |
root |
string | none | Project directory. Nx knows it, so you rarely set this. |
config |
string | none | Path of the Astro config file. Without it Astro finds astro.config.* itself. |
outputPath |
string | none | Directory to serve, overriding outDir of the Astro config. |
site |
string | none | Overrides site of the Astro config. |
base |
string | none | Overrides base of the Astro config. |
verbose |
boolean | false |
Verbose output. |
open |
string | boolean | false |
Opens the browser when the server starts; a string is the URL to open. |
additionalArgs |
array | none | More command-line arguments for Astro. |
Example
Section titled “Example”nx preview my-app --port=8080