Refactor
This commit is contained in:
@@ -21,17 +21,11 @@ const files = [
|
||||
eventFiles.map(f => `src/events/${f}`)
|
||||
].flat()
|
||||
|
||||
const banner = [
|
||||
"const bun__build = true",
|
||||
process.env.DOCKER === "1" ? "const bun__docker = true" : null
|
||||
].filter(v => typeof v === "string").join("\n")
|
||||
|
||||
await Bun.build({
|
||||
entrypoints: ["src/index.ts", ...files],
|
||||
outdir: "dist",
|
||||
target: "bun",
|
||||
splitting: true,
|
||||
minify: true,
|
||||
sourcemap: process.env.NODE_ENV === "dev" ? "external" : undefined,
|
||||
naming: {
|
||||
entry: "[dir]/[name].[ext]",
|
||||
@@ -39,5 +33,5 @@ await Bun.build({
|
||||
asset: "asset/[name]-[hash].[ext]"
|
||||
},
|
||||
root: "src",
|
||||
banner
|
||||
banner: process.env.DOCKER === "1" ? "process.env.BUN__DOCKER = 'true'" : undefined
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user