-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
40 lines (38 loc) · 1.09 KB
/
tsdown.config.ts
File metadata and controls
40 lines (38 loc) · 1.09 KB
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 'tsdown';
const commonConfig = {
deps: {
onlyBundle: false,
},
dts: true,
format: 'esm',
outDir: 'es',
} as const;
export default defineConfig([
{
...commonConfig,
clean: true,
entry: {
'headless': 'src/headless/index.ts',
// Emit the LiteXML command identities as their own chunk so the bundled
// node build references them instead of inlining a second copy. Both this
// entry and the unbundled browser build resolve to the same emitted
// `es/plugins/litexml/command/symbols.js`, giving the commands a single
// runtime identity (and a DOM-free import via `./litexml-commands`).
'plugins/litexml/command/symbols': 'src/plugins/litexml/command/symbols.ts',
},
outExtensions: () => ({ dts: '.d.ts', js: '.js' }),
platform: 'node',
},
{
...commonConfig,
clean: false,
entry: {
codemirror: 'src/codemirror/index.ts',
index: 'src/index.ts',
react: 'src/react/index.ts',
renderer: 'src/renderer/index.ts',
},
platform: 'browser',
unbundle: true,
},
]);