-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
tsup.config.ts
32 lines (29 loc) · 906 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
import type { Options } from 'tsup';
import { defineConfig } from 'tsup';
const tsconfig = 'tsconfig.build.json' satisfies Options['tsconfig'];
export default defineConfig((options): Options[] => {
const commonOptions: Options = {
entry: { index: 'src/index.ts' },
sourcemap: true,
tsconfig,
clean: true,
target: ['esnext'],
outDir: 'lib',
splitting: false,
removeNodeProtocol: false,
shims: true,
...options,
};
return [
{ ...commonOptions, name: 'Modern ESM', format: ['esm'], entry: { index: 'src/index.ts' }, dts: true },
{ ...commonOptions, name: 'CJS Development', format: ['cjs'], entry: { index: 'src/index.ts' }, dts: true },
{
...commonOptions,
format: ['esm'],
name: 'CLI Development',
external: ['@rtk-query/codegen-openapi'],
minify: true,
entry: { 'bin/cli': 'src/bin/cli.ts' },
},
];
});