26 lines
754 B
TypeScript
26 lines
754 B
TypeScript
import type { UserConfig } from 'tsdown'
|
|
|
|
const PLUGIN_ID = 'dsh-brain'
|
|
|
|
export default {
|
|
name: PLUGIN_ID + '/client',
|
|
entry: { index: 'src-client/index.ts' },
|
|
outDir: 'client',
|
|
format: 'cjs',
|
|
platform: 'browser',
|
|
target: 'es2022',
|
|
fixedExtension: false,
|
|
outExtensions: () => ({ js: '.js' }),
|
|
dts: false,
|
|
sourcemap: false,
|
|
clean: false,
|
|
deps: { neverBundle: [/^react(?:\/.*)?$/, /^react-dom(?:\/.*)?$/] },
|
|
define: { 'process.env.NODE_ENV': '"production"' },
|
|
plugins: [],
|
|
outputOptions: {
|
|
banner: `window.__ModuleLoader__.load({ id: '${PLUGIN_ID}', factory: (require) => {`,
|
|
intro: 'var module = { exports: {} }; var exports = module.exports;',
|
|
footer: 'return module.exports; } });',
|
|
},
|
|
} satisfies UserConfig
|