From 5f62d2d3ec2cfbb39b0663e96b82746384ef1b89 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Fri, 16 Sep 2022 22:40:22 +0200 Subject: [PATCH] Just found out esbuild has a logLevel prop --- build.mjs | 18 +++++------------- src/components/Settings.tsx | 1 - 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/build.mjs b/build.mjs index 3c31f53e..d6de0d2d 100755 --- a/build.mjs +++ b/build.mjs @@ -7,12 +7,7 @@ import { performance } from "perf_hooks"; /** * @type {esbuild.WatchMode|false} */ -const watch = process.argv.includes("--watch") ? { - onRebuild: (err) => { - if (err) console.error("Build Error", err.message); - else console.log("Rebuilt!"); - } -} : false; +const watch = process.argv.includes("--watch"); // https://github.com/evanw/esbuild/issues/619#issuecomment-751995294 /** @@ -77,9 +72,9 @@ const gitHashPlugin = { } }; -const begin = performance.now(); await Promise.all([ esbuild.build({ + logLevel: "info", entryPoints: ["src/preload.ts"], outfile: "dist/preload.js", format: "cjs", @@ -91,6 +86,7 @@ await Promise.all([ watch }), esbuild.build({ + logLevel: "info", entryPoints: ["src/patcher.ts"], outfile: "dist/patcher.js", bundle: true, @@ -103,6 +99,7 @@ await Promise.all([ watch }), esbuild.build({ + logLevel: "info", entryPoints: ["src/Vencord.ts"], outfile: "dist/renderer.js", format: "iife", @@ -119,12 +116,7 @@ await Promise.all([ watch, minify: true, }) -]).then(res => { - const took = performance.now() - begin; - console.log(`Built in ${took.toFixed(2)}ms`); -}).catch(err => { +]).catch(err => { console.error("Build failed"); console.error(err.message); }); - -if (watch) console.log("Watching..."); \ No newline at end of file diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index 89159c4e..1e13d7fe 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -7,7 +7,6 @@ import { Button, ButtonProps, Flex, Switch, Forms, React } from "../webpack/comm import ErrorBoundary from "./ErrorBoundary"; import { startPlugin } from "../plugins"; import { stopPlugin } from '../plugins/index'; -import { openModal, closeModal } from '../utils/modal'; export default ErrorBoundary.wrap(function Settings(props) { const [settingsDir, , settingsDirPending] = useAwaiter(() => VencordNative.ipc.invoke(IpcEvents.GET_SETTINGS_DIR), "Loading...");