feat(config-editor): scaffold extension manifest, build, i18n

This commit is contained in:
panFD
2026-06-20 23:46:15 +08:00
parent 315a1a6af9
commit acb038a70a
8 changed files with 1414 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
import { build, context } from 'esbuild';
import { readFileSync } from 'fs';
import { join } from 'path';
const watch = process.argv.includes('--watch');
const common = {
bundle: true,
sourcemap: false,
logLevel: 'info',
alias: { 'vue': 'vue/dist/vue.esm-bundler.js' },
};
const entries = [
{ entryPoints: ['src/main/index.ts'], outfile: 'dist/main.js', platform: 'node', format: 'cjs', external: [] },
{ entryPoints: ['src/panels/default/index.ts'], outfile: 'dist/panels/default.js', platform: 'browser', format: 'iife', external: [] },
];
if (watch) {
for (const e of entries) {
const ctx = await context({ ...common, ...e });
await ctx.watch();
}
} else {
for (const e of entries) await build({ ...common, ...e });
}