nextvm dev
Dev mode with file watching, incremental rebuilds, and an optional local FXServer subprocess.
Synopsis
bash
nextvm dev # rebuild watcher only
nextvm dev --serve # rebuild watcher + local FXServer subprocessFlags
| Flag | Description |
|---|---|
--serve | Spawn a local FXServer subprocess against your built modules. Requires a fxserver block in nextvm.config.ts. See Local FXServer. |
What it does
- Loads the project
- Runs an initial full build (so the dev session starts from a known state)
- Starts a chokidar watcher on each module's
src/ - On change → debounces, rebuilds the affected module with
skipLocales: truefor speed - Writes
.nextvm/dev-trigger.jsonso the runtime-server's dev bridge canensure-restart the resource inside FXServer - With
--serve: also spawns FXServer, links modules intoresources/[nextvm]/, generatesserver.cfg.nextvm, and streams the FXServer logs into your terminal with a cyan[fx]prefix
The session stays alive until you hit Ctrl+C. Cleanup tears down the watcher, the FXServer process tree, and the symlinks.
Example output (--serve)
▲ NextVM v0.0.x
dev — watching modules for changes
› Initial build of 3 module(s)…
✓ Initial build completed in 64ms
[runner] Resolved FXServer binary: C:\fivem\server\FXServer.exe
[runner] Linked 3 module(s) (symlinks)
[runner] Wrote C:\fivem\server-data\server.cfg.nextvm
[runner] FXServer started (PID 12345)
✓ FXServer running (PID 12345)
✓ Watching 3 modules for changes
Press Ctrl+C to stop.
[fx] [ resources] Started resource shop
...
22:42:10 ● Rebuilding shop…
22:42:10 ✓ shop rebuilt in 9ms
[runner] ensure shop (via dev-trigger)
[fx] [resources] Stopping resource shop
[fx] [resources] Started resource shopSee also
nextvm serve— one-shot build + FXServer, no watchernextvm build— one-shot production build- Local FXServer — full setup walkthrough
@nextvm/buildpackage reference