feat(config-editor): scaffold extension manifest, build, i18n
This commit is contained in:
26
extensions/pixelhero-config-editor/esbuild.config.mjs
Normal file
26
extensions/pixelhero-config-editor/esbuild.config.mjs
Normal 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 });
|
||||
}
|
||||
Reference in New Issue
Block a user