From 3af9a14a0e78be88c5a048b79187c32796c06a7c Mon Sep 17 00:00:00 2001 From: Ven Date: Sun, 30 Oct 2022 02:58:11 +0100 Subject: Patcher: More useful errors with code diffs (#177) * Patcher: More useful errors with code diffs * Nicer log formatting * PluginCards: ellipsises --- scripts/build/build.mjs | 9 +++++---- scripts/build/buildWeb.mjs | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/build/build.mjs b/scripts/build/build.mjs index bbf8105..82264ee 100755 --- a/scripts/build/build.mjs +++ b/scripts/build/build.mjs @@ -19,10 +19,11 @@ import esbuild from "esbuild"; -import { commonOpts, gitHash, globPlugins, isStandalone } from "./common.mjs"; +import { commonOpts, gitHash, globPlugins, isStandalone, watch } from "./common.mjs"; const defines = { - IS_STANDALONE: isStandalone + IS_STANDALONE: isStandalone, + IS_DEV: JSON.stringify(watch) }; if (defines.IS_STANDALONE === "false") // If this is a local build (not standalone), optimise @@ -81,8 +82,8 @@ await Promise.all([ ...commonOpts.plugins ], define: { - IS_WEB: "false", - IS_STANDALONE: isStandalone + ...defines, + IS_WEB: false } }), ]).catch(err => { diff --git a/scripts/build/buildWeb.mjs b/scripts/build/buildWeb.mjs index f0197b7..1efdd8f 100755 --- a/scripts/build/buildWeb.mjs +++ b/scripts/build/buildWeb.mjs @@ -26,7 +26,7 @@ import { join } from "path"; // wtf is this assert syntax import PackageJSON from "../../package.json" assert { type: "json" }; -import { commonOpts, fileIncludePlugin, gitHashPlugin, gitRemotePlugin, globPlugins } from "./common.mjs"; +import { commonOpts, fileIncludePlugin, gitHashPlugin, gitRemotePlugin, globPlugins, watch } from "./common.mjs"; /** * @type {esbuild.BuildOptions} @@ -46,7 +46,8 @@ const commonOptions = { target: ["esnext"], define: { IS_WEB: "true", - IS_STANDALONE: "true" + IS_STANDALONE: "true", + IS_DEV: JSON.stringify(watch) } }; -- cgit