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

View File

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

View File

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

View File

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