-
-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
39 lines (38 loc) · 938 Bytes
/
tsdown.config.ts
File metadata and controls
39 lines (38 loc) · 938 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
34
35
36
37
38
39
// import { dts } from './dist/index.js' // to test built version
import { RequireCJS } from 'rolldown-plugin-require-cjs'
import { defineConfig } from 'tsdown'
import ApiSnapshot from 'tsnapi/rolldown'
import { dts } from './src/index.ts'
export default defineConfig({
entry: {
index: './src/index.ts',
internal: './src/internal.ts',
tsc: './src/tsc/index.ts',
'tsc-context': './src/tsc/context.ts',
'tsc-worker': './src/tsc/worker.ts',
},
platform: 'node',
dts: false,
define: {
'import.meta.WORKER_URL': JSON.stringify('./tsc-worker.mjs'),
},
deps: {
onlyBundle: [],
},
treeshake: {
moduleSideEffects: false,
},
exports: true,
plugins: [
dts({
oxc: true,
}),
ApiSnapshot(),
RequireCJS({
shouldTransform(id) {
// perf: TypeScript is large and takes time to detect ESM/CJS.
if (id === 'typescript') return true
},
}),
],
})