From ed89311c3f51b4a50479b2dd32701119db7ac255 Mon Sep 17 00:00:00 2001 From: seth Date: Sun, 18 May 2025 21:26:18 -0400 Subject: [PATCH] fix: improve production build process and remove unused imports --- src/back/index.ts | 1 + src/front/components/NavigationBar/index.tsx | 1 - src/index.ts | 6 +++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/back/index.ts b/src/back/index.ts index 09b1677..f87dae8 100644 --- a/src/back/index.ts +++ b/src/back/index.ts @@ -11,6 +11,7 @@ const build = async () => { sourcemap: "linked", splitting: true, publicPath: "/assets/", + drop: (development ? [] : ["console", "debugger"]), }); }; diff --git a/src/front/components/NavigationBar/index.tsx b/src/front/components/NavigationBar/index.tsx index a4bf269..82317e0 100644 --- a/src/front/components/NavigationBar/index.tsx +++ b/src/front/components/NavigationBar/index.tsx @@ -5,7 +5,6 @@ import "mdui/components/button-icon"; import "@mdui/icons/person--outlined"; import "@mdui/icons/person--rounded"; -import "@mdui/icons/more-vert--rounded"; export default () => { return ( diff --git a/src/index.ts b/src/index.ts index 7fa2998..1708a10 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,13 +3,17 @@ import { file, gc, serve } from "bun"; import pkg from "../package.json"; import Backend from "./back"; +if (!Backend.development) { + process.env.NODE_ENV = "PRODUCTION"; +} + let heartrate = 0; let lanyard: LanyardData = { discord_status: "online", activities: [], }; -await fs.rm("./dist", { recursive: true, force: true }).catch(() => {}); +await fs.rm("./dist", { recursive: true, force: true }).catch(() => { }); if (!Backend.development) { await Backend.build();