tsdown.worker.ts 642 B

12345678910111213
  1. /** Fixed startup code for Node Worker bundles, after the executable's VFS bootstrap. */
  2. /**
  3. * Load the parent's profile resolver before Worker business code executes.
  4. * ESM static dependencies must resolve without the profile resolver.
  5. * @param format - emitted Worker module format.
  6. * @returns a tsdown banner that loads the shared native Worker bootstrap.
  7. */
  8. export function profileWorkerBanner(format: 'cjs' | 'esm'): string {
  9. return format === 'cjs'
  10. ? '"use strict";\nrequire("@deepseek-ai/dsh-app-boot/worker/profile-resolution-bootstrap");'
  11. : 'import "@deepseek-ai/dsh-app-boot/worker/profile-resolution-bootstrap";'
  12. }