aboutsummaryrefslogtreecommitdiff
path: root/build.mjs
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-08-29 18:45:58 +0200
committerVendicated <vendicated@riseup.net>2022-08-29 18:45:58 +0200
commit1709ab61ef2138d350b3d45a3eba0d94d5adf0a1 (patch)
tree92cfba166ee58f268ac617197d462f4b4dab1af5 /build.mjs
parent876e622f4f61a4aa229ad69782d374335c3d8d6b (diff)
downloadVencord-1709ab61ef2138d350b3d45a3eba0d94d5adf0a1.tar.gz
Vencord-1709ab61ef2138d350b3d45a3eba0d94d5adf0a1.tar.bz2
Vencord-1709ab61ef2138d350b3d45a3eba0d94d5adf0a1.zip
Fix NPE when opening DevTools
Diffstat (limited to 'build.mjs')
-rwxr-xr-xbuild.mjs12
1 files changed, 9 insertions, 3 deletions
diff --git a/build.mjs b/build.mjs
index 237b219..6459c63 100755
--- a/build.mjs
+++ b/build.mjs
@@ -4,16 +4,19 @@ import { readdirSync } from "fs";
import { performance } from "perf_hooks";
/**
- * @type {esbuild.WatchMode}
+ * @type {esbuild.WatchMode|false}
*/
-const watch = {
+const watch = process.argv.includes("--watch") ? {
onRebuild: (err) => {
if (err) console.error("Build Error", err.message);
else console.log("Rebuilt!");
}
-};
+} : false;
// https://github.com/evanw/esbuild/issues/619#issuecomment-751995294
+/**
+ * @type {esbuild.Plugin}
+ */
const makeAllPackagesExternalPlugin = {
name: 'make-all-packages-external',
setup(build) {
@@ -22,6 +25,9 @@ const makeAllPackagesExternalPlugin = {
},
};
+/**
+ * @type {esbuild.Plugin}
+ */
const globPlugins = {
name: "glob-plugins",
setup: build => {