-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
32 lines (31 loc) · 983 Bytes
/
Copy pathtsup.config.ts
File metadata and controls
32 lines (31 loc) · 983 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
import { defineConfig } from 'tsup';
export default defineConfig([
{
// npm entry: ESM + CJS. The panel is a dynamic import, so a bundler can drop
// it entirely from builds that never call attachUI().
entry: { index: 'src/index.ts' },
format: ['esm', 'cjs'],
outDir: 'dist',
target: 'es2020',
dts: true,
sourcemap: true,
splitting: true,
clean: true,
treeshake: true,
},
{
// Classic <script src> / unpkg build: one self-contained minified file.
// tsup appends ".global.js" for the iife format → dist/candy-logger.global.js
entry: { 'candy-logger': 'src/global.ts' },
format: ['iife'],
// Deliberately not "CandyLogger": tsup emits `var <globalName> = (...)` which
// would overwrite the class that global.ts assigns to window.CandyLogger.
globalName: 'CandyLoggerBundle',
outDir: 'dist',
target: 'es2020',
dts: false,
sourcemap: true,
minify: true,
treeshake: true,
},
]);