forked from mswjs/interceptors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsup.config.ts
34 lines (31 loc) · 833 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
33
34
import { Options, defineConfig } from 'tsup'
const nodeConfig: Options = {
entry: [
'./src/index.ts',
'./src/presets/node.ts',
'./src/RemoteHttpInterceptor.ts',
'./src/interceptors/ClientRequest/index.ts',
'./src/interceptors/XMLHttpRequest/index.ts',
'./src/interceptors/fetch/index.ts',
],
outDir: './lib/node',
platform: 'node',
format: ['cjs', 'esm'],
sourcemap: true,
dts: true,
}
const browserConfig: Options = {
entry: [
'./src/index.ts',
'./src/presets/browser.ts',
'./src/interceptors/XMLHttpRequest/index.ts',
'./src/interceptors/fetch/index.ts',
'./src/interceptors/WebSocket/index.ts',
],
outDir: './lib/browser',
platform: 'browser',
format: ['cjs', 'esm'],
sourcemap: true,
dts: true,
}
export default defineConfig([nodeConfig, browserConfig])