-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsup.config.ts
40 lines (33 loc) · 1.09 KB
/
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
35
36
37
38
39
40
import { defineConfig } from 'tsup';
export default defineConfig({
// The entry to bundle.
entry: [
'src/**/*.ts',
'!src/**/__fixtures__/**/*',
'!src/**/__mocks__/**/*',
'!src/**/__test__/**/*',
'!src/**/__tests__/**/*',
'!src/**/__snapshots__/**/*',
'!src/**/*.test.ts',
'!src/**/*.test-d.ts',
'!src/**/*.test.*.ts',
],
// The output formats. We want to generate both CommonJS and ESM bundles.
// https://tsup.egoist.dev/#bundle-formats
format: ['cjs', 'esm'],
// Generate sourcemaps as separate files.
// https://tsup.egoist.dev/#generate-sourcemap-file
sourcemap: true,
// Clean the dist folder before bundling.
clean: true,
// Enables shimming of `__dirname` and `import.meta.url`, so that they work
// in both CommonJS and ESM.
// https://tsup.egoist.dev/#inject-cjs-and-esm-shims
shims: true,
// Hide unnecessary logs from the console. Warnings and errors will still be
// shown.
silent: true,
// Split the output into chunks. This is useful for tree-shaking.
// https://tsup.egoist.dev/#code-splitting
splitting: true,
});