summary refs log tree commit diff
path: root/scripts/build/remap_imports.js
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-30 15:13:18 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-30 15:13:18 +1000
commitc2931f61aa0adb682ab023d85ba599099024d62b (patch)
tree86de9071cbded565fe9e082bd2cc6c611a926c6c /scripts/build/remap_imports.js
parentGuild join messages (diff)
parentOop, deprecated typeorm call (diff)
downloadserver-c2931f61aa0adb682ab023d85ba599099024d62b.tar.xz
Merge branch 'staging' into dev/Maddy/feat/welcomeMessages
Diffstat (limited to 'scripts/build/remap_imports.js')
-rw-r--r--scripts/build/remap_imports.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/build/remap_imports.js b/scripts/build/remap_imports.js
new file mode 100644
index 00000000..cdcd571a
--- /dev/null
+++ b/scripts/build/remap_imports.js
@@ -0,0 +1,15 @@
+const { execSync } = require("child_process");
+const path = require("path");
+const fs = require("fs");
+const { argv, stdout, exit } = require("process");
+const { execIn, parts, getDirs, walk, sanitizeVarName } = require("../utils");
+
+module.exports = function (config) {
+	console.log(`==> Remapping module imports...`);
+	let files = walk(config.distDir).filter((x) => x.endsWith(".js"));
+	files.forEach((x) => {
+		let fc = fs.readFileSync(x).toString();
+		fc = fc.replaceAll("@fosscord/", "#");
+		fs.writeFileSync(x, fc);
+	});
+};