[fix] loaded without registering

This commit is contained in:
zhhe committed 2026-11-16 13:56:52 +08:00
1 parent c668bef62a
commit 68075f2dee
3 files changed
+127 -89

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { build } from 'esbuild'
const id = 'dsh-mail-sender'
await build({
entryPoints: ['src/client/index.ts'],
outfile: 'lib/client/index.js',
bundle: true,
format: 'cjs',
platform: 'browser',
jsx: 'automatic',
external: ['react', 'react/jsx-runtime', 'react-dom', '@deepseek-ai/cordis'],
banner: {
js: `window.__ModuleLoader__.load({id:${JSON.stringify(id)},factory:require=>{var module={exports:{}};var exports=module.exports;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});`,
},
footer: {
js: 'Object.defineProperty(module.exports,Symbol.toStringTag,{value:"Module"});return module.exports}});',
},
})