watch: enable sourcemaps and disable minify
This commit is contained in:
parent
01ae0983b3
commit
20237f5664
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user