mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-10 15:13:02 -04:00
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...");
|
Loading…
Add table
Add a link
Reference in a new issue