Skip to content

Commit 588f3c3

Browse files
committed
build(dev): Add launch config and PORT-driven server binding
Track .claude/launch.json (dev/preview blueprint with autoPort) while keeping the rest of .claude — notably worktrees/ — ignored. vite.config now reads PORT from the env and pins server/preview to it with strictPort, so tools like the launcher can hand a fixed port through. Assisted-by: ClaudeCode:claude-opus-4-8
1 parent 56f950d commit 588f3c3

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

.claude/launch.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22
"version": "0.0.1",
33
"configurations": [
44
{
5-
"name": "audiotrail-dev",
6-
"runtimeExecutable": "npm",
5+
"name": "dev",
6+
"runtimeExecutable": "pnpm",
77
"runtimeArgs": ["run", "dev"],
8-
"port": 5173
8+
"port": 5185,
9+
"autoPort": true
10+
},
11+
{
12+
"name": "preview",
13+
"runtimeExecutable": "pnpm",
14+
"runtimeArgs": ["run", "preview"],
15+
"port": 5186,
16+
"autoPort": true
917
}
1018
]
1119
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ coverage/
55
.vite/
66
*.local
77
.DS_Store
8+
.claude/*
9+
!.claude/launch.json

vite.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { VitePWA } from "vite-plugin-pwa";
1111
const buildDate = new Date().toISOString().replace(/\.\d{3}Z$/, "Z");
1212
const buildSha = execSync("git rev-parse --short HEAD").toString().trim();
1313

14+
const port = process.env.PORT ? Number(process.env.PORT) : undefined;
15+
1416
/**
1517
* Serves the developer's own gitignored sample takeout (data/Audible.zip)
1618
* at /__sample/Audible.zip during `vite serve` only. `apply: 'serve'` means
@@ -78,6 +80,8 @@ export default defineConfig({
7880
},
7981
}),
8082
],
83+
server: { port, strictPort: port !== undefined },
84+
preview: { port, strictPort: port !== undefined },
8185
resolve: {
8286
tsconfigPaths: true,
8387
},

0 commit comments

Comments
 (0)