diff options
author | V <vendicated@riseup.net> | 2023-04-04 01:16:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-04 01:16:29 +0200 |
commit | 6b26c12bfa1f28d40834478b50d2f7b09c9f54fb (patch) | |
tree | 48687349f9bf6803ee8993b3eafa3ea1e4f3dff2 /scripts/build/build.mjs | |
parent | 5bb08bdb6465eebc9dcf80ba2971d894b804abb8 (diff) | |
download | Vencord-6b26c12bfa1f28d40834478b50d2f7b09c9f54fb.tar.gz Vencord-6b26c12bfa1f28d40834478b50d2f7b09c9f54fb.tar.bz2 Vencord-6b26c12bfa1f28d40834478b50d2f7b09c9f54fb.zip |
Add additional build flavours for Vencord Desktop (#765)
Diffstat (limited to 'scripts/build/build.mjs')
-rwxr-xr-x | scripts/build/build.mjs | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/scripts/build/build.mjs b/scripts/build/build.mjs index 70a05cf..a4b06f5 100755 --- a/scripts/build/build.mjs +++ b/scripts/build/build.mjs @@ -48,6 +48,7 @@ const sourceMapFooter = s => watch ? "" : `//# sourceMappingURL=vencord://${s}.j const sourcemap = watch ? "inline" : "external"; await Promise.all([ + // common preload esbuild.build({ ...nodeCommonOpts, entryPoints: ["src/preload.ts"], @@ -55,12 +56,19 @@ await Promise.all([ footer: { js: "//# sourceURL=VencordPreload\n" + sourceMapFooter("preload") }, sourcemap, }), + + // Discord Desktop main & renderer esbuild.build({ ...nodeCommonOpts, - entryPoints: ["src/patcher.ts"], + entryPoints: ["src/main/index.ts"], outfile: "dist/patcher.js", footer: { js: "//# sourceURL=VencordPatcher\n" + sourceMapFooter("patcher") }, sourcemap, + define: { + ...defines, + IS_DISCORD_DESKTOP: true, + IS_VENCORD_DESKTOP: false + } }), esbuild.build({ ...commonOpts, @@ -77,7 +85,43 @@ await Promise.all([ ], define: { ...defines, - IS_WEB: false + IS_WEB: false, + IS_DISCORD_DESKTOP: true, + IS_VENCORD_DESKTOP: false + } + }), + + // Vencord Desktop main & renderer + esbuild.build({ + ...nodeCommonOpts, + entryPoints: ["src/main/index.ts"], + outfile: "dist/vencordDesktopMain.js", + footer: { js: "//# sourceURL=VencordDesktopMain\n" + sourceMapFooter("vencordDesktopMain") }, + sourcemap, + define: { + ...defines, + IS_DISCORD_DESKTOP: false, + IS_VENCORD_DESKTOP: true + } + }), + esbuild.build({ + ...commonOpts, + entryPoints: ["src/Vencord.ts"], + outfile: "dist/vencordDesktopRenderer.js", + format: "iife", + target: ["esnext"], + footer: { js: "//# sourceURL=VencordDesktopRenderer\n" + sourceMapFooter("vencordDesktopRenderer") }, + globalName: "Vencord", + sourcemap, + plugins: [ + globPlugins, + ...commonOpts.plugins + ], + define: { + ...defines, + IS_WEB: false, + IS_DISCORD_DESKTOP: false, + IS_VENCORD_DESKTOP: true } }), ]).catch(err => { |