Skill Tracer
Skills › Compound Engineering › ce-polish › dev-server-nuxt.md

dev-server-nuxt.md

58 lines · skills/ce-polish/references/dev-server-nuxt.md at 3449230

Open on GitHub
1# Nuxt dev-server recipe (auto-detect fallback)
2
3Loaded when `detect-project-type.sh` returns `nuxt` and the startup tuple still lacks a command.
4

Nuxt dev-server recipe (auto-detect fallback)

Loaded when detect-project-type.sh returns nuxt and the startup tuple still lacks a command.

Raw lines 1 to 4
5## Signature
6
7- `nuxt.config.js`, `nuxt.config.mjs`, or `nuxt.config.ts` exists
8- `package.json` contains a `nuxt` dependency
9

Signature

  • nuxt.config.js, nuxt.config.mjs, or nuxt.config.ts exists
  • package.json contains a nuxt dependency
Raw lines 5 to 9
10## Start command
12Standard:
14```bash
15npm run dev
16```
18Also valid (read `package.json` scripts to confirm which the project uses):
20```bash
21pnpm dev
22yarn dev
23bun run dev
24```
26Prefer the package manager indicated by the lockfile:
27- `pnpm-lock.yaml` -> `pnpm dev`
28- `yarn.lock` -> `yarn dev`
29- `bun.lock` / `bun.lockb` -> `bun run dev`
30- `package-lock.json` or none -> `npm run dev`

Start command

Standard:

npm run dev

Also valid (read package.json scripts to confirm which the project uses):

pnpm dev
yarn dev
bun run dev

Prefer the package manager indicated by the lockfile:

  • pnpm-lock.yaml -> pnpm dev
  • yarn.lock -> yarn dev
  • bun.lock / bun.lockb -> bun run dev
  • package-lock.json or none -> npm run dev
Raw lines 10 to 31
32## Port
34Default: `3000`. Nuxt respects `--port <port>` and the `PORT` env var. Overrides follow the cascade in `references/dev-server-detection.md`.

Port

Default: 3000. Nuxt respects --port <port> and the PORT env var. Overrides follow the cascade in references/dev-server-detection.md.

Raw lines 32 to 35
36## Stub generation
38```json
40 "version": "0.2.0",
41 "configurations": [
42 {
43 "name": "Nuxt dev",
44 "runtimeExecutable": "npm",
45 "runtimeArgs": ["run", "dev"],
46 "port": 3000
47 }
48 ]
50```
52Substitute the resolved package manager (`npm` / `pnpm` / `yarn` / `bun`) and port.

Stub generation

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Nuxt dev",
      "runtimeExecutable": "npm",
      "runtimeArgs": ["run", "dev"],
      "port": 3000
    }
  ]
}

Substitute the resolved package manager (npm / pnpm / yarn / bun) and port.

Raw lines 36 to 53
54## Common gotchas
56- **Nitro server engine:** Nitro (Nuxt's server engine) adds its own dev server behind Nuxt's; polish only cares about the Nuxt port. Do not probe the Nitro internal port separately.
57- **Port auto-increment:** Nuxt may move to another port when 3000 is occupied. If the resolved URL does not answer, use the server log to let the user correct the start configuration.
58- **Nuxt 3 vs Nuxt 2:** Nuxt 3 uses `nuxt.config.ts`, Nuxt 2 uses `nuxt.config.js` -- both are detected by the signature check. The dev-server command and port defaults are the same across both versions.

Common gotchas

  • Nitro server engine: Nitro (Nuxt's server engine) adds its own dev server behind Nuxt's; polish only cares about the Nuxt port. Do not probe the Nitro internal port separately.
  • Port auto-increment: Nuxt may move to another port when 3000 is occupied. If the resolved URL does not answer, use the server log to let the user correct the start configuration.
  • Nuxt 3 vs Nuxt 2: Nuxt 3 uses nuxt.config.ts, Nuxt 2 uses nuxt.config.js -- both are detected by the signature check. The dev-server command and port defaults are the same across both versions.
Raw lines 54 to 58