Just found out esbuild has a logLevel prop
This commit is contained in:
parent
8cc43cdc7c
commit
5f62d2d3ec
2 changed files with 5 additions and 14 deletions
18
build.mjs
18
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...");
|
|
@ -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...");
|
||||
|
|
Loading…
Reference in a new issue