forked from imbytecat/fullstack-starter
refactor: 重命名 outfilePrefix 为 outfile 并统一更新代码
- 将构建配置中的 outfilePrefix 更名为 outfile,并统一更新相关代码以使用新的字段名。
This commit is contained in:
@@ -26,7 +26,7 @@ type BunTarget = Schema.Schema.Type<typeof BunTargetSchema>
|
|||||||
const BuildConfigSchema = Schema.Struct({
|
const BuildConfigSchema = Schema.Struct({
|
||||||
entrypoint: Schema.String.pipe(Schema.nonEmptyString()),
|
entrypoint: Schema.String.pipe(Schema.nonEmptyString()),
|
||||||
outputDir: Schema.String.pipe(Schema.nonEmptyString()),
|
outputDir: Schema.String.pipe(Schema.nonEmptyString()),
|
||||||
outfilePrefix: Schema.String.pipe(Schema.nonEmptyString()),
|
outfile: Schema.String.pipe(Schema.nonEmptyString()),
|
||||||
targets: Schema.Array(BunTargetSchema).pipe(Schema.minItems(1)),
|
targets: Schema.Array(BunTargetSchema).pipe(Schema.minItems(1)),
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ class BuildConfigService extends Context.Tag('BuildConfigService')<
|
|||||||
BuildConfigService.fromRaw({
|
BuildConfigService.fromRaw({
|
||||||
entrypoint: '.output/server/index.mjs',
|
entrypoint: '.output/server/index.mjs',
|
||||||
outputDir: 'out',
|
outputDir: 'out',
|
||||||
outfilePrefix: 'server',
|
outfile: 'server',
|
||||||
targets: ['bun-windows-x64', 'bun-darwin-arm64', 'bun-linux-x64'],
|
targets: ['bun-windows-x64', 'bun-darwin-arm64', 'bun-linux-x64'],
|
||||||
} satisfies BuildConfig),
|
} satisfies BuildConfig),
|
||||||
)
|
)
|
||||||
@@ -150,7 +150,7 @@ class BuildService extends Context.Tag('BuildService')<
|
|||||||
Bun.build({
|
Bun.build({
|
||||||
entrypoints: [config.entrypoint],
|
entrypoints: [config.entrypoint],
|
||||||
compile: {
|
compile: {
|
||||||
outfile: `${config.outfilePrefix}-${getTargetSuffix(target)}`,
|
outfile: `${config.outfile}-${getTargetSuffix(target)}`,
|
||||||
target: target,
|
target: target,
|
||||||
},
|
},
|
||||||
outdir: config.outputDir,
|
outdir: config.outputDir,
|
||||||
@@ -181,7 +181,7 @@ class BuildService extends Context.Tag('BuildService')<
|
|||||||
Bun.build({
|
Bun.build({
|
||||||
entrypoints: [config.entrypoint],
|
entrypoints: [config.entrypoint],
|
||||||
compile: {
|
compile: {
|
||||||
outfile: `${config.outfilePrefix}-${getTargetSuffix(target)}`,
|
outfile: `${config.outfile}-${getTargetSuffix(target)}`,
|
||||||
target: target,
|
target: target,
|
||||||
},
|
},
|
||||||
outdir: config.outputDir,
|
outdir: config.outputDir,
|
||||||
|
|||||||
Reference in New Issue
Block a user