Just found out esbuild has a logLevel prop

This commit is contained in:
Vendicated 2022-09-16 22:40:22 +02:00
parent 8cc43cdc7c
commit 5f62d2d3ec
No known key found for this signature in database
GPG key ID: EC781ADFB93EFFA3
2 changed files with 5 additions and 14 deletions

View file

@ -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...");

View file

@ -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<string>(IpcEvents.GET_SETTINGS_DIR), "Loading...");