"重构模块依赖并添加查询应用功能"

This commit is contained in:
2025-05-17 15:54:46 +08:00
parent 15c868ac70
commit 7075e9b097
17 changed files with 1811 additions and 7 deletions

View 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' });
}