@@ -34,7 +34,7 @@ async function main() {
34
34
await deleteFolder ( path . userServerPath ( 'docs' ) )
35
35
log . info ( ` ${ path . userServerPath ( 'storage' ) } ` , { styled : false } )
36
36
await deleteFolder ( path . userServerPath ( 'storage' ) )
37
- log . info ( 'Deleted old files' )
37
+ log . success ( 'Deleted old files' )
38
38
39
39
log . info ( 'Building...' )
40
40
const result = await build ( {
@@ -46,11 +46,18 @@ async function main() {
46
46
// minify: true,
47
47
} )
48
48
49
- await outro ( {
50
- dir : import . meta. dir ,
51
- startTime,
52
- result,
53
- } )
49
+ if ( result . success ) {
50
+ log . success ( 'Server built' )
51
+ } else {
52
+ log . error ( 'Build failed' )
53
+ process . exit ( 1 )
54
+ }
55
+
56
+ // await outro({
57
+ // dir: import.meta.dir,
58
+ // startTime,
59
+ // result,
60
+ // })
54
61
55
62
await useCustomOrDefaultServerConfig ( )
56
63
@@ -70,11 +77,9 @@ async function main() {
70
77
files . push ( file )
71
78
}
72
79
73
- console . log ( 'asdasdass' , files )
74
-
75
- const r2 = await build ( {
80
+ const r2 = await Bun . build ( {
76
81
root,
77
- entrypoints : files ,
82
+ entrypoints : files . map ( ( file ) => path . resolve ( root , file ) ) ,
78
83
outdir : path . frameworkPath ( 'server/dist/app' ) ,
79
84
format : 'esm' ,
80
85
target : 'bun' ,
@@ -84,6 +89,15 @@ async function main() {
84
89
external : [ '@swc/wasm' ] ,
85
90
} )
86
91
92
+ if ( r2 . success ) {
93
+ log . success ( 'App built' )
94
+ } else {
95
+ log . error ( 'Build failed' )
96
+ console . log ( r2 )
97
+ console . log ( r2 . logs )
98
+ process . exit ( 1 )
99
+ }
100
+
87
101
// TODO: this is a bundler issue and those files should not need to be copied, and that's why we handle the cleanup here as well
88
102
// await runCommand(`cp -r ${path.storagePath('app')} ${path.userServerPath()}`)
89
103
// await runCommand(`rm -rf ${path.storagePath('app')}`)
0 commit comments