watch: enable sourcemaps and disable minify

This commit is contained in:
Vendicated 2022-10-16 17:21:23 +02:00
parent 01ae0983b3
commit 20237f5664
No known key found for this signature in database
GPG Key ID: EC781ADFB93EFFA3
3 changed files with 5 additions and 9 deletions

@ -10,6 +10,7 @@ const nodeCommonOpts = {
format: "cjs", format: "cjs",
platform: "node", platform: "node",
target: ["esnext"], target: ["esnext"],
minify: true,
sourcemap: "linked", sourcemap: "linked",
plugins: [makeAllPackagesExternalPlugin], plugins: [makeAllPackagesExternalPlugin],
}; };
@ -38,8 +39,6 @@ await Promise.all([
globPlugins, globPlugins,
gitHashPlugin gitHashPlugin
], ],
sourcemap: "inline",
minify: true,
define: { define: {
IS_WEB: "false" IS_WEB: "false"
} }

@ -15,8 +15,6 @@ const commonOptions = {
entryPoints: ["browser/Vencord.ts"], entryPoints: ["browser/Vencord.ts"],
globalName: "Vencord", globalName: "Vencord",
format: "iife", format: "iife",
minify: true,
sourcemap: false,
external: ["plugins", "git-hash"], external: ["plugins", "git-hash"],
plugins: [ plugins: [
globPlugins, globPlugins,

@ -2,10 +2,7 @@ import { execSync } from "child_process";
import esbuild from "esbuild"; import esbuild from "esbuild";
import { readdir } from "fs/promises"; import { readdir } from "fs/promises";
/** const watch = process.argv.includes("--watch");
* @type {esbuild.WatchMode|false}
*/
export const watch = process.argv.includes("--watch");
/** /**
* @type {esbuild.BuildOptions} * @type {esbuild.BuildOptions}
@ -13,7 +10,9 @@ export const watch = process.argv.includes("--watch");
export const commonOpts = { export const commonOpts = {
logLevel: "info", logLevel: "info",
bundle: true, bundle: true,
watch watch,
minify: !watch,
sourcemap: watch ? "inline" : ""
}; };
// https://github.com/evanw/esbuild/issues/619#issuecomment-751995294 // https://github.com/evanw/esbuild/issues/619#issuecomment-751995294