Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

tsdown.config.ts

42 lines849 Bytes

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