2026-07-08 11:00:06 +08:00
|
|
|
import { defineConfig } from 'tsdown'
|
|
|
|
|
|
|
|
|
|
/**
|
2026-07-14 00:40:36 +08:00
|
|
|
* Build the index and worker as separate single-entry bundles. The sibling `worker.cjs` is loaded
|
|
|
|
|
* by file and must be CommonJS for pkg's VFS Worker hook. A multi-entry build emits an unlisted
|
|
|
|
|
* shared chunk omitted by the package's exact `files` whitelist; separate builds inline it.
|
2026-07-08 11:00:06 +08:00
|
|
|
*/
|
2026-07-08 12:55:14 +08:00
|
|
|
export default defineConfig([
|
|
|
|
|
{
|
|
|
|
|
entry: ['lib/types/index.js'],
|
|
|
|
|
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-08 12:55:14 +08:00
|
|
|
platform: 'node',
|
|
|
|
|
target: 'es2024',
|
|
|
|
|
fixedExtension: false,
|
|
|
|
|
dts: false,
|
|
|
|
|
clean: false,
|
|
|
|
|
},
|
|
|
|
|
])
|