Skip minify in debug builds

This commit is contained in:
Damien Elmes 2022-12-04 10:05:16 +10:00
parent f2ca87b1d8
commit ecfa557043
2 changed files with 4 additions and 4 deletions

View file

@ -6,7 +6,7 @@ import { sassPlugin } from "esbuild-sass-plugin";
import sveltePlugin from "esbuild-svelte"; import sveltePlugin from "esbuild-svelte";
import { readFileSync, writeFileSync } from "fs"; import { readFileSync, writeFileSync } from "fs";
import { basename } from "path"; import { basename } from "path";
import { argv } from "process"; import { argv, env } from "process";
import sveltePreprocess from "svelte-preprocess"; import sveltePreprocess from "svelte-preprocess";
import { typescript } from "svelte-preprocess-esbuild"; import { typescript } from "svelte-preprocess-esbuild";
@ -26,7 +26,7 @@ build({
entryPoints: [entrypoint], entryPoints: [entrypoint],
globalName: "anki", globalName: "anki",
outfile: bundle_js, outfile: bundle_js,
minify: true, minify: env.RELEASE && true,
loader: { ".svg": "text" }, loader: { ".svg": "text" },
preserveSymlinks: true, preserveSymlinks: true,
sourcemap: false, sourcemap: false,

View file

@ -2,7 +2,7 @@
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { build } from "esbuild"; import { build } from "esbuild";
import { argv } from "process"; import { argv, env } from "process";
const [_node, _script, entrypoint, bundle_js] = argv; const [_node, _script, entrypoint, bundle_js] = argv;
@ -13,7 +13,7 @@ build({
bundle: true, bundle: true,
entryPoints: [entrypoint], entryPoints: [entrypoint],
outfile: bundle_js, outfile: bundle_js,
minify: true, minify: env.RELEASE && true,
preserveSymlinks: true, preserveSymlinks: true,
target, target,
}).catch(() => process.exit(1)); }).catch(() => process.exit(1));