-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsup.config.ts
34 lines (33 loc) · 998 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 { defineConfig } from 'tsup'
export default defineConfig({
entry: ['src/index.ts'],
format: ['cjs', 'esm'],
// Inject cjs and esm shims:https://tsup.egoist.dev/#inject-cjs-and-esm-shims
shims: true,
// splitting: true,
// sourcemap: true,
// clean: true,
minify: 'terser',
terserOptions: {
// compress: {
// drop_console: true,
// drop_debugger: true,
// },
// https://terser.org/docs/options/#mangle-options
"mangle": {
"properties": {
"regex": /^_[$]/,
// "undeclared": true, // Mangle those names when they are accessed as properties of known top level variables but their declarations are never found in input code.
},
"toplevel": true,
"reserved": [
// # expected names in web-extension content
"WeakSet", "Set",
// # expected names in 3rd-party extensions' contents
"requestIdleCallback",
// # content global names:
"browser",
],
}
},
})