Skip to content

Commit a97342a

Browse files
authored
Fixed admin-toolbar pnpm dev crash on empty umd/ (#28962)
no ref `vite preview` exits immediately when its `outDir` doesn't exist, which kills `concurrently --kill-others` and takes the whole `pnpm dev` Nx fan-out down with it. Before [#28936](#28936) a tracked `umd/admin-toolbar.min.js` masked this on fresh clones; without it, any fresh clone or `pnpm build:clean` reproduces it. Fix: ensure `umd/` exists before `concurrently` launches preview. Preview boots against an empty dir, serves 404 for the bundle for the ~1s before `build:watch` emits its first artifact, then starts serving the real file. No upfront full build needed. Verified locally: with `umd/` removed, `pnpm dev` produces a 200 on `http://localhost:4176/admin-toolbar.min.js` by t=2s (was: immediate crash + chain termination). Peer public apps (portal, comments-ui, announcement-bar, sodo-search, signup-form) avoid the same trap by running `pnpm build &&` upfront. Left alone here — worth revisiting as a separate "template the public-app dev scripts" pass.
1 parent d2163f5 commit a97342a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/admin-toolbar/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"scripts": {
2121
"build": "pnpm exec vite build",
2222
"build:watch": "pnpm exec vite build --watch --mode development",
23-
"dev": "concurrently --kill-others --names preview,build \"pnpm exec vite preview -l silent\" \"pnpm build:watch\"",
23+
"dev": "mkdir -p umd && concurrently --kill-others --names preview,build \"pnpm exec vite preview -l silent\" \"pnpm build:watch\"",
2424
"lint": "pnpm exec eslint src test --cache",
2525
"test": "pnpm test:unit",
2626
"test:unit": "pnpm run build && pnpm exec vitest run",

0 commit comments

Comments
 (0)