fix
This commit is contained in:
@@ -1,20 +1,24 @@
|
||||
// @ts-check
|
||||
// https://bun.sh/docs/bundler
|
||||
// @ts-ignore
|
||||
import pkg from './package.json';
|
||||
import { resolvePath as rp } from '@kevisual/use-config/env';
|
||||
// bun run src/index.ts --
|
||||
import { resolvePath } from '@kevisual/use-config/env';
|
||||
import { execSync } from 'node:child_process';
|
||||
|
||||
const entry = 'src/index.ts';
|
||||
const naming = 'app';
|
||||
/**
|
||||
* @type {import('bun').BuildConfig}
|
||||
*/
|
||||
await Bun.build({
|
||||
target: 'node',
|
||||
format: 'esm',
|
||||
entrypoints: [rp('./src/main.ts')],
|
||||
outdir: rp('./dist'),
|
||||
entrypoints: [resolvePath(entry, { meta: import.meta })],
|
||||
outdir: resolvePath('./dist', { meta: import.meta }),
|
||||
naming: {
|
||||
entry: 'app.mjs',
|
||||
},
|
||||
|
||||
define: {
|
||||
VERSION: JSON.stringify(pkg.version),
|
||||
entry: `${naming}.js`,
|
||||
},
|
||||
external: [],
|
||||
env: 'KEVISUAL_*',
|
||||
});
|
||||
|
||||
// const cmd = `dts -i src/index.ts -o app.d.ts`;
|
||||
const cmd = `dts -i ${entry} -o ${naming}.d.ts`;
|
||||
execSync(cmd, { stdio: 'inherit' });
|
||||
|
||||
Reference in New Issue
Block a user