File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,23 @@ export const generateWranglerCommand = defineCommand({
3434 await fs . mkdir ( tempDir , { recursive : true } ) ;
3535
3636 // Bundling wrangler.ts to clean ESM
37- const buildResult = await Bun . build ( {
38- entrypoints : [ wranglerTsPath ] ,
39- outdir : tempDir ,
40- target : "node" ,
41- format : "esm" ,
42- } ) ;
37+ let buildResult : Bun . BuildOutput | undefined
38+ try {
39+ buildResult = await Bun . build ( {
40+ entrypoints : [ wranglerTsPath ] ,
41+ outdir : tempDir ,
42+ target : "node" ,
43+ format : "esm" ,
44+ } ) ;
45+ } catch ( error ) {
46+ console . error ( error ) ;
47+ }
48+
49+ if ( ! buildResult ) {
50+ throw new Error (
51+ `Failed to bundle wrangler.ts. Unknown error.` ,
52+ ) ;
53+ }
4354
4455 if ( ! buildResult . success ) {
4556 console . log ( buildResult . logs ) ;
You can’t perform that action at this time.
0 commit comments