forked from vercel/ai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsup.config.ts
50 lines (49 loc) · 1.07 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { defineConfig } from 'tsup'
export default defineConfig([
// Universal APIs
{
entry: ['streams/index.ts'],
format: ['cjs', 'esm'],
external: ['react', 'svelte', 'vue'],
dts: true
},
// React APIs
{
entry: ['react/index.ts'],
outDir: 'react/dist',
banner: {
js: "'use client'"
},
format: ['cjs', 'esm'],
external: ['react', 'svelte', 'vue'],
dts: true
},
{
entry: ['react/index.server.ts'],
outDir: 'react/dist',
format: ['cjs', 'esm'],
external: ['react', 'svelte', 'vue'],
dts: true
},
// Svelte APIs
{
entry: ['svelte/index.ts'],
outDir: 'svelte/dist',
banner: {},
format: ['cjs', 'esm'],
external: ['react', 'svelte', 'vue'],
dts: true,
// `sswr` has some issue with `.es.js` that can't be resolved correctly by
// vite so we have to bundle it here.
noExternal: ['sswr']
},
// Vue APIs
{
entry: ['vue/index.ts'],
outDir: 'vue/dist',
banner: {},
format: ['cjs', 'esm'],
external: ['react', 'svelte', 'vue'],
dts: true
}
])