-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
33 lines (32 loc) · 905 Bytes
/
tsup.config.ts
File metadata and controls
33 lines (32 loc) · 905 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
import { defineConfig } from 'tsup'
export default defineConfig({
entry: ['src/**/*.ts'],
format: 'esm',
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",
],
}
},
})