Init renderer, expose settings via ipc, init canary/ptb support
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
import { BuildContext, BuildOptions, context } from "esbuild";
|
||||
|
||||
const NodeCommonOpts: BuildOptions = {
|
||||
format: "cjs",
|
||||
platform: "node",
|
||||
external: ["electron"],
|
||||
const CommonOpts: BuildOptions = {
|
||||
minify: true,
|
||||
bundle: true,
|
||||
sourcemap: "linked",
|
||||
logLevel: "info"
|
||||
};
|
||||
|
||||
const NodeCommonOpts: BuildOptions = {
|
||||
...CommonOpts,
|
||||
format: "cjs",
|
||||
platform: "node",
|
||||
external: ["electron"],
|
||||
target: ["esnext"],
|
||||
};
|
||||
|
||||
const contexts = [] as BuildContext[];
|
||||
async function createContext(options: BuildOptions) {
|
||||
contexts.push(await context(options));
|
||||
@@ -25,6 +30,12 @@ await Promise.all([
|
||||
...NodeCommonOpts,
|
||||
entryPoints: ["src/preload/index.ts"],
|
||||
outfile: "dist/js/preload.js"
|
||||
}),
|
||||
createContext({
|
||||
...CommonOpts,
|
||||
entryPoints: ["src/renderer/index.ts"],
|
||||
outfile: "dist/js/renderer.js",
|
||||
format: "iife",
|
||||
})
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user