From bc80f432b1e106c0b12d05f10130aae385223d33 Mon Sep 17 00:00:00 2001 From: amsyarasyiq <82711525+amsyarasyiq@users.noreply.github.com> Date: Sat, 18 May 2024 12:38:32 +0800 Subject: [PATCH] feat: dev builds init --- build.mjs | 5 ++++- src/core/ui/settings/index.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build.mjs b/build.mjs index b05af40..c985652 100644 --- a/build.mjs +++ b/build.mjs @@ -1,3 +1,4 @@ +/* eslint-disable no-restricted-syntax */ // eslint-disable-next-line simple-import-sort/imports import swc from "@swc/core"; import { execSync } from "child_process"; @@ -32,6 +33,9 @@ try { footer: { js: "//# sourceURL=bunny" }, + define: { + __DEV__: String(!isRelease) + }, loader: { ".png": "dataurl" }, legalComments: "none", plugins: [ @@ -65,7 +69,6 @@ try { }); build.onEnd(result => { - const { outfile } = build.initialOptions; console.log(`Built with ${result.errors?.length} errors!`); }); } diff --git a/src/core/ui/settings/index.ts b/src/core/ui/settings/index.ts index 5503a65..a844e10 100644 --- a/src/core/ui/settings/index.ts +++ b/src/core/ui/settings/index.ts @@ -14,7 +14,7 @@ export const PyoncordIcon = _PyoncordIcon as string; export default function initSettings() { registerSection({ - name: "Bunny", + name: "Bunny" + (__DEV__ ? " (DEV)" : ""), items: [ { key: "BUNNY", @@ -56,6 +56,7 @@ export default function initSettings() { }); // Compat for plugins which injects into the settings + // Flaw: in the old UI, this will be displayed anyway with no items registerSection({ name: "Vendetta", items: []