-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
66 lines (64 loc) · 1.47 KB
/
tsup.config.ts
File metadata and controls
66 lines (64 loc) · 1.47 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// tsup.config.ts
import { defineConfig } from 'tsup';
const entry = [
'src/index.ts',
'src/core/index.ts',
'src/core/constants.ts',
'src/adapters/viem/index.ts',
'src/adapters/viem/client.ts',
'src/adapters/viem/sdk.ts',
'src/adapters/ethers/index.ts',
'src/adapters/ethers/client.ts',
'src/adapters/ethers/sdk.ts',
'!src/**/__tests__/**',
'!src/**/__mocks__/**',
'!src/**/e2e/**',
'!src/**/*.e2e.ts',
'!src/**/e2e/**',
'!test/**',
'!src/adapters/__tests__/**',
];
export default defineConfig([
{
entry,
outDir: 'dist',
format: ['esm'],
target: 'es2022',
bundle: true,
splitting: true,
treeshake: true,
sourcemap: false,
skipNodeModulesBundle: true,
external: ['ethers', 'viem', '@typechain/ethers-v6'],
dts: false,
clean: false,
minify: false,
shims: false,
outExtension: () => ({ js: '.js' }),
tsconfig: 'tsconfig.build.json',
loader: { '.json': 'json' },
},
// CJS sourcemaps
{
entry,
outDir: 'dist',
format: ['cjs'],
target: 'es2022',
bundle: true,
splitting: false,
treeshake: true,
sourcemap: true,
skipNodeModulesBundle: true,
external: ['ethers', 'viem', '@typechain/ethers-v6'],
dts: false,
clean: false,
minify: false,
shims: false,
outExtension: () => ({ js: '.cjs' }),
tsconfig: 'tsconfig.build.json',
loader: { '.json': 'json' },
esbuildOptions(options) {
options.sourcesContent = false;
},
},
]);