forked from Lilly-Protocol/lily-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
47 lines (43 loc) · 955 Bytes
/
Copy pathtsup.config.ts
File metadata and controls
47 lines (43 loc) · 955 Bytes
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
import { defineConfig, type Options } from 'tsup';
import pkg from './package.json' assert { type: 'json' };
const commonEntry = [
'src/index.ts',
'src/config.ts',
'src/errors.ts',
'src/http.ts',
'src/models.ts',
'src/types.ts',
'src/pagination.ts',
] as string[];
export const nodeConfig: Options = {
entry: commonEntry,
format: ['esm', 'cjs'],
define: {
__LILY_SDK_VERSION__: JSON.stringify(pkg.version),
},
dts: {
compilerOptions: {
exactOptionalPropertyTypes: true,
},
},
sourcemap: true,
clean: true,
splitting: false,
treeshake: true,
target: 'node20',
outDir: 'dist',
};
export const browserConfig: Options = {
entry: commonEntry,
format: ['esm'],
dts: false,
sourcemap: true,
splitting: false,
treeshake: true,
target: 'es2022',
platform: 'browser',
outDir: 'dist/browser',
external: [],
noExternal: [],
};
export default defineConfig([nodeConfig, browserConfig]);