"重构模块依赖并添加查询应用功能"
This commit is contained in:
30
packages/query-app/bun.config.mjs
Normal file
30
packages/query-app/bun.config.mjs
Normal file
@@ -0,0 +1,30 @@
|
||||
// @ts-check
|
||||
import { resolvePath, getDevInputs } from '@kevisual/use-config/env';
|
||||
import { execSync } from 'node:child_process';
|
||||
import glob from 'fast-glob';
|
||||
|
||||
const files = await glob('src/*.ts');
|
||||
const inputs = getDevInputs(files);
|
||||
const external = ['@kevisual/router'];
|
||||
for (let input of inputs) {
|
||||
const entry = input.path;
|
||||
const naming = input.naming;
|
||||
/**
|
||||
* @type {import('bun').BuildConfig}
|
||||
*/
|
||||
await Bun.build({
|
||||
target: 'node',
|
||||
format: 'esm',
|
||||
entrypoints: [resolvePath(entry, { meta: import.meta })],
|
||||
outdir: resolvePath('./dist', { meta: import.meta }),
|
||||
|
||||
naming: {
|
||||
entry: naming + '.js',
|
||||
},
|
||||
external: external,
|
||||
env: 'KEVISUAL_*',
|
||||
});
|
||||
|
||||
const cmd = `dts -i ${entry} -o ${naming}.d.ts`;
|
||||
execSync(cmd, { stdio: 'inherit' });
|
||||
}
|
||||
Reference in New Issue
Block a user