aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-10-15 20:56:48 +0200
committerVendicated <vendicated@riseup.net>2022-10-15 20:56:48 +0200
commit845088ec024d56af4d7fdd4cd861c2aa89dbceb6 (patch)
tree845e6469dea05bbe5250e9d21fcee69c9596b7d4
parent9c7b548a9e8dbcf39360d3eb5eef9e5dad29e40b (diff)
downloadVencord-845088ec024d56af4d7fdd4cd861c2aa89dbceb6.tar.gz
Vencord-845088ec024d56af4d7fdd4cd861c2aa89dbceb6.tar.bz2
Vencord-845088ec024d56af4d7fdd4cd861c2aa89dbceb6.zip
buildWeb: suppress experimental api warnings
-rw-r--r--buildWeb.mjs2
-rw-r--r--package.json2
-rw-r--r--scripts/suppressExperimentalWarnings.js6
3 files changed, 8 insertions, 2 deletions
diff --git a/buildWeb.mjs b/buildWeb.mjs
index afb8b33..0bd6618 100644
--- a/buildWeb.mjs
+++ b/buildWeb.mjs
@@ -1,4 +1,4 @@
-// TODO: Modularise these plugins since both build scripts use them
+// TODO: Modularise the plugins since both build scripts use them
import { execSync } from "child_process";
import { createWriteStream, readdirSync, readFileSync } from "fs";
diff --git a/package.json b/package.json
index ed48f73..48734b3 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
},
"scripts": {
"build": "node build.mjs",
- "buildWeb": "node buildWeb.mjs",
+ "buildWeb": "node --require=./scripts/suppressExperimentalWarnings.js buildWeb.mjs",
"inject": "node scripts/patcher/install.js",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "pnpm lint --fix",
diff --git a/scripts/suppressExperimentalWarnings.js b/scripts/suppressExperimentalWarnings.js
new file mode 100644
index 0000000..dd5cd79
--- /dev/null
+++ b/scripts/suppressExperimentalWarnings.js
@@ -0,0 +1,6 @@
+process.emit = (originalEmit => function (name, data) {
+ if (name === "warning" && data?.name === "ExperimentalWarning")
+ return false;
+
+ return originalEmit.apply(process, arguments);
+})(process.emit);