diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-08-30 15:13:18 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-08-30 15:13:18 +1000 |
commit | c2931f61aa0adb682ab023d85ba599099024d62b (patch) | |
tree | 86de9071cbded565fe9e082bd2cc6c611a926c6c /scripts/build/remap_imports.js | |
parent | Guild join messages (diff) | |
parent | Oop, deprecated typeorm call (diff) | |
download | server-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.js | 15 |
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); + }); +}; |