File tree Expand file tree Collapse file tree 3 files changed +7
-12
lines changed
Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change 55 "type" : " module" ,
66 "scripts" : {
77 "dev" : " vite" ,
8- "build" : " vite build && vite build --mode client " ,
8+ "build" : " vite build --mode client && vite build" ,
99 "preview" : " wrangler pages dev" ,
1010 "deploy" : " bun run build && wrangler pages deploy dist" ,
1111 "typecheck" : " bunx tsc --noEmit"
Original file line number Diff line number Diff line change @@ -7,20 +7,14 @@ type ManifestEntry = {
77 isEntry ?: boolean ;
88} ;
99
10- let manifest : Record < string , ManifestEntry > | null = null ;
10+ type Manifest = Record < string , ManifestEntry > ;
1111
12- try {
13- // @ts -expect-error manifest.json only exists after build
14- manifest = await import ( "../dist/.vite/manifest.json" ) ;
15- } catch {
16- // Ignore - manifest doesn't exist during development/typecheck
17- }
12+ // @ts -expect-error manifest.json only exists after client build
13+ import manifest from "../dist/.vite/manifest.json" with { type : "json" } ;
1814
1915export function getClientScriptPath ( ) : string {
20- if ( ! manifest ) {
21- throw new Error ( "Manifest not found - run build first" ) ;
22- }
23- const entry = manifest [ "src/client/main.ts" ] ;
16+ const m = manifest as Manifest ;
17+ const entry = m [ "src/client/main.ts" ] ;
2418 if ( ! entry ) {
2519 throw new Error ( "Client entry not found in manifest" ) ;
2620 }
Original file line number Diff line number Diff line change 77 ],
88 "type" : " module" ,
99 "scripts" : {
10+ "clean" : " rm -rf apps/*/dist apps/*/.wrangler" ,
1011 "dev" : " bun run --filter @wdmock/main dev" ,
1112 "dev:files" : " bun run --filter @wdmock/files dev" ,
1213 "dev:all" : " bun run dev & bun run dev:files" ,
You can’t perform that action at this time.
0 commit comments