2026-07-09 18:39:31 +08:00
|
|
|
import { defineConfig } from 'tsdown'
|
|
|
|
|
|
|
|
|
|
/**
|
2026-07-14 00:40:36 +08:00
|
|
|
* Build the engine and worker separately so each inlines shared modules; a
|
|
|
|
|
* multi-entry build creates an unlisted chunk. The path-loaded worker is
|
|
|
|
|
* CommonJS because pkg's VFS Worker hook compiles it in that format.
|
2026-07-09 18:39:31 +08:00
|
|
|
*/
|
|
|
|
|
export default defineConfig([
|
|
|
|
|
{
|
2026-07-19 22:13:50 +08:00
|
|
|
entry: ['lib/types/index.js', 'lib/types/invariant.js'],
|
2026-07-09 18:39:31 +08:00
|
|
|
outDir: 'lib',
|
|
|
|
|
format: ['esm'],
|
|
|
|
|
platform: 'node',
|
|
|
|
|
target: 'es2024',
|
|
|
|
|
fixedExtension: false,
|
|
|
|
|
dts: false,
|
|
|
|
|
clean: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
entry: ['lib/types/worker.js'],
|
|
|
|
|
outDir: 'lib',
|
2026-07-13 20:55:47 +08:00
|
|
|
format: ['cjs'],
|
2026-07-09 18:39:31 +08:00
|
|
|
platform: 'node',
|
|
|
|
|
target: 'es2024',
|
|
|
|
|
fixedExtension: false,
|
|
|
|
|
dts: false,
|
|
|
|
|
clean: false,
|
|
|
|
|
},
|
|
|
|
|
])
|