-
Notifications
You must be signed in to change notification settings - Fork 44
/
tsup.config.ts
34 lines (33 loc) · 875 Bytes
/
tsup.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import fs from 'node:fs';
import { defineConfig } from 'tsup';
export default defineConfig([
{
entry: ['./src/index.ts', './src/auto.ts', './src/rsc-shim.ts'],
outDir: './dist',
splitting: false,
sourcemap: false,
format: ['cjs', 'esm', 'iife'],
target: 'esnext',
platform: 'browser',
treeshake: true,
dts: true,
minify: process.env.NODE_ENV === 'production' ? 'terser' : false,
env: {
NODE_ENV: process.env.NODE_ENV ?? 'development',
},
external: ['react', 'react-dom', 'react-reconciler'],
},
{
entry: ['./src/cli.mts'],
outDir: './dist',
splitting: false,
sourcemap: false,
format: ['cjs'],
target: 'esnext',
platform: 'node',
minify: process.env.NODE_ENV === 'production' ? 'terser' : false,
env: {
NODE_ENV: process.env.NODE_ENV ?? 'development',
},
},
]);