-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
28 lines (27 loc) · 872 Bytes
/
Copy pathtsdown.config.ts
File metadata and controls
28 lines (27 loc) · 872 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
import { defineConfig } from 'tsdown'
import { cpSync } from 'node:fs'
export default defineConfig({
entry: [
'src/**/*.ts',
'!src/**/*.test.ts',
'!src/server/ui/**',
'!src/types/modules.d.ts',
],
format: 'esm',
dts: true,
unbundle: true,
outExtensions: () => ({ js: '.js', dts: '.d.ts' }),
external: ['lightningcss'],
outDir: 'dist',
clean: true,
hooks: {
'build:done': () => {
// Copy Vue components (resolved at runtime by unplugin-vue-components)
cpSync('src/components', 'dist/components', { recursive: true })
// Copy dev UI (served at runtime by Vite)
cpSync('src/server/ui', 'dist/server/ui', { recursive: true })
// Copy the parallel-build worker entry (plain JS, loaded by tinypool at runtime)
cpSync('src/render/parallel/worker.mjs', 'dist/render/parallel/worker.mjs')
},
},
})