Open History to see the last commit
1import { defineConfig } from 'tsdown'
2import solid from 'unplugin-solid/rolldown'
3import type { UserConfig } from 'tsdown'
4β
5const baseConfig: UserConfig = {
6 target: 'esnext',
7 platform: 'browser',
8 format: ['esm', 'cjs'],
9 outDir: 'build',
10 fixedExtension: false,
11}
12β
13const environment = (development: boolean) => ({
14 NODE_ENV: development ? 'development' : 'production',
15 PROD: !development,
16 DEV: development,
17 SSR: false,
18})
19β
20export default defineConfig([
21 {
22 ...baseConfig,
23 entry: { index: 'src/index.ts' },
24 clean: true,
25 dts: true,
26 env: environment(false),
27 minify: {
28 compress: {
29 dropConsole: true,
30 dropDebugger: true,
31 },
32 },
33 plugins: [solid()],
34 },
35 {
36 ...baseConfig,
37 entry: { dev: 'src/index.ts' },
38 clean: false,
39 dts: false,
40 env: environment(true),
41 plugins: [solid()],
42 },
43])