-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsup.config.ts
50 lines (49 loc) · 1.15 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 { readdirSync } from 'node:fs';
import path from 'node:path';
import { defineConfig } from 'tsup';
export default defineConfig([
{
entry: ['src/bin.ts'],
splitting: false,
sourcemap: true,
clean: true,
format: ['esm'],
platform: 'node',
tsconfig: './tsconfig.json',
target: 'node18',
shims: false,
dts: false,
outExtension: () => ({ js: '.mjs' }),
},
{
entry: ['src/index.ts'],
splitting: false,
sourcemap: true,
clean: true,
format: ['cjs', 'esm'],
platform: 'node',
tsconfig: './tsconfig.json',
target: 'node18',
shims: false,
dts: true,
legacyOutput: true,
onSuccess: `echo '{"type":"module"}' > dist/esm/package.json`,
},
{
entry: readdirSync(path.resolve('src', 'adapters')).map(
(filename) => 'src/adapters/' + filename,
),
splitting: false,
sourcemap: true,
clean: true,
format: ['cjs', 'esm'],
platform: 'node',
tsconfig: './tsconfig.json',
target: 'node18',
shims: false,
dts: true,
legacyOutput: true,
outDir: './adapters',
onSuccess: `echo '{"type":"module"}' > adapters/esm/package.json`,
},
]);