mirror of
https://github.com/zoriya/v10.git
synced 2026-08-05 05:37:21 +00:00
28 lines
703 B
TypeScript
28 lines
703 B
TypeScript
import type { UserConfig } from 'tsdown';
|
|
import { defineConfig } from 'tsdown';
|
|
|
|
type BuildMode = 'dev' | 'default';
|
|
|
|
const buildModes: BuildMode[] = ['dev', 'default'];
|
|
|
|
const createConfig = (mode: BuildMode): UserConfig => ({
|
|
entry: {
|
|
index: './src/core/index.ts',
|
|
html: './src/html/index.ts',
|
|
react: './src/react/index.ts',
|
|
},
|
|
platform: 'neutral',
|
|
format: 'es',
|
|
sourcemap: true,
|
|
clean: true,
|
|
hash: false,
|
|
unbundle: true,
|
|
outDir: `dist/${mode}`,
|
|
define: {
|
|
__DEV__: mode === 'dev' ? 'true' : 'false',
|
|
},
|
|
dts: mode === 'dev' ? { tsgo: true, tsconfig: 'tsconfig.dts.json' } : false,
|
|
});
|
|
|
|
export default defineConfig(buildModes.map((mode) => createConfig(mode)));
|