Skip to content

Commit 3f1c1ac

Browse files
committed
chore: wip
1 parent 69e5fdf commit 3f1c1ac

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

storage/framework/server/build.ts

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async function main() {
3434
await deleteFolder(path.userServerPath('docs'))
3535
log.info(` ${path.userServerPath('storage')}`, { styled: false })
3636
await deleteFolder(path.userServerPath('storage'))
37-
log.info('Deleted old files')
37+
log.success('Deleted old files')
3838

3939
log.info('Building...')
4040
const result = await build({
@@ -46,11 +46,18 @@ async function main() {
4646
// minify: true,
4747
})
4848

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+
// })
5461

5562
await useCustomOrDefaultServerConfig()
5663

@@ -70,11 +77,9 @@ async function main() {
7077
files.push(file)
7178
}
7279

73-
console.log('asdasdass', files)
74-
75-
const r2 = await build({
80+
const r2 = await Bun.build({
7681
root,
77-
entrypoints: files,
82+
entrypoints: files.map((file) => path.resolve(root, file)),
7883
outdir: path.frameworkPath('server/dist/app'),
7984
format: 'esm',
8085
target: 'bun',
@@ -84,6 +89,15 @@ async function main() {
8489
external: ['@swc/wasm'],
8590
})
8691

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+
87101
// 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
88102
// await runCommand(`cp -r ${path.storagePath('app')} ${path.userServerPath()}`)
89103
// await runCommand(`rm -rf ${path.storagePath('app')}`)

0 commit comments

Comments
 (0)