2026-07-08 11:00:06 +08:00
|
|
|
import { defineConfig } from 'tsdown'
|
|
|
|
|
|
|
|
|
|
/**
|
2026-07-28 23:00:00 +08:00
|
|
|
* Build the plugin, reusable runtime host, and worker as separate bundles. The
|
|
|
|
|
* sibling `worker.cjs` is loaded by file and must be CommonJS for pkg's VFS
|
|
|
|
|
* Worker hook. Separate builds inline shared implementation instead of
|
|
|
|
|
* emitting an unlisted chunk outside the exact `files` whitelist.
|
2026-07-08 11:00:06 +08:00
|
|
|
*/
|
2026-07-08 12:55:14 +08:00
|
|
|
export default defineConfig([
|
|
|
|
|
{
|
2026-07-19 22:13:50 +08:00
|
|
|
entry: ['lib/types/index.js', 'lib/types/invariant.js'],
|
2026-07-08 12:55:14 +08:00
|
|
|
outDir: 'lib',
|
|
|
|
|
format: ['esm'],
|
|
|
|
|
platform: 'node',
|
|
|
|
|
target: 'es2024',
|
|
|
|
|
fixedExtension: false,
|
|
|
|
|
dts: false,
|
|
|
|
|
clean: false,
|
|
|
|
|
},
|
2026-07-28 23:00:00 +08:00
|
|
|
{
|
|
|
|
|
entry: ['lib/types/runtime-host.js'],
|
|
|
|
|
outDir: 'lib',
|
|
|
|
|
format: ['esm'],
|
|
|
|
|
platform: 'node',
|
|
|
|
|
target: 'es2024',
|
|
|
|
|
fixedExtension: false,
|
|
|
|
|
dts: false,
|
|
|
|
|
clean: false,
|
|
|
|
|
},
|
2026-07-08 12:55:14 +08:00
|
|
|
{
|
|
|
|
|
entry: ['lib/types/worker.js'],
|
|
|
|
|
outDir: 'lib',
|
2026-07-13 20:55:47 +08:00
|
|
|
format: ['cjs'],
|
2026-07-08 12:55:14 +08:00
|
|
|
platform: 'node',
|
|
|
|
|
target: 'es2024',
|
|
|
|
|
fixedExtension: false,
|
|
|
|
|
dts: false,
|
|
|
|
|
clean: false,
|
|
|
|
|
},
|
|
|
|
|
])
|