-
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathtsup.config.ts
More file actions
36 lines (34 loc) · 706 Bytes
/
Copy pathtsup.config.ts
File metadata and controls
36 lines (34 loc) · 706 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
import { defineConfig } from 'tsup';
const commonConfig = {
entry: ['src/index.ts'],
dts: true,
sourcemap: false,
splitting: false,
treeshake: true,
minify: true,
outExtension() {
return {
js: '.js',
};
},
};
// tsup outputs to flat structure, so we need separate configs for cjs and esm
// to match the current lib/cjs/ and lib/esm/ structure
export default [
// CJS build
defineConfig({
...commonConfig,
format: ['cjs'],
outDir: 'lib/cjs',
// Suppress warning about named and default exports
banner: {
js: '"use strict";',
},
}),
// ESM build
defineConfig({
...commonConfig,
format: ['esm'],
outDir: 'lib/esm',
}),
];