首次提交

This commit is contained in:
2025-03-26 13:40:54 +08:00
commit aada5ef8c4
34 changed files with 9013 additions and 0 deletions

21
config/esbuild.common.ts Normal file
View File

@@ -0,0 +1,21 @@
import type esbuild from 'esbuild';
export default {
entryPoints: {
'index': './src/index',
},
entryNames: '[name]',
assetNames: '[name]',
bundle: true, // 用于内部方法调用,请勿修改
minify: false, // 用于内部方法调用,请勿修改
loader: {},
outdir: './dist/',
sourcemap: undefined,
platform: 'browser', // 用于内部方法调用,请勿修改
format: 'iife', // 用于内部方法调用,请勿修改
globalName: 'edaEsbuildExportName', // 用于内部方法调用,请勿修改
treeShaking: true,
ignoreAnnotations: true,
define: {},
external: [],
} satisfies Parameters<(typeof esbuild)['build']>[0];

13
config/esbuild.prod.ts Normal file
View File

@@ -0,0 +1,13 @@
import esbuild from 'esbuild';
import common from './esbuild.common';
(async () => {
const ctx = await esbuild.context(common);
if (process.argv.includes('--watch')) {
await ctx.watch();
} else {
await ctx.rebuild();
process.exit();
}
})();