diff --git a/cdn/src/Server.ts b/src/cdn/Server.ts
index 5b395589..5b395589 100644
--- a/cdn/src/Server.ts
+++ b/src/cdn/Server.ts
diff --git a/cdn/src/index.ts b/src/cdn/index.ts
index a24300d6..a24300d6 100644
--- a/cdn/src/index.ts
+++ b/src/cdn/index.ts
diff --git a/cdn/src/routes/attachments.ts b/src/cdn/routes/attachments.ts
index ae50bc48..ae50bc48 100644
--- a/cdn/src/routes/attachments.ts
+++ b/src/cdn/routes/attachments.ts
diff --git a/cdn/src/routes/avatars.ts b/src/cdn/routes/avatars.ts
index e5e25a4c..e5e25a4c 100644
--- a/cdn/src/routes/avatars.ts
+++ b/src/cdn/routes/avatars.ts
diff --git a/cdn/src/routes/external.ts b/src/cdn/routes/external.ts
index fc12c017..cb17ff9b 100644
--- a/cdn/src/routes/external.ts
+++ b/src/cdn/routes/external.ts
@@ -3,7 +3,7 @@ import fetch from "node-fetch";
import { HTTPError } from "lambert-server";
import { Snowflake } from "@fosscord/util";
import { storage } from "../util/Storage";
-import FileType, { stream } from "file-type";
+import FileType from "file-type";
import { Config } from "@fosscord/util";
import sharp from "sharp";
diff --git a/cdn/src/routes/guilds.ts b/src/cdn/routes/guilds.ts
index 3c4b646c..3c4b646c 100644
--- a/cdn/src/routes/guilds.ts
+++ b/src/cdn/routes/guilds.ts
diff --git a/cdn/src/routes/ping.ts b/src/cdn/routes/ping.ts
index 38daf81e..38daf81e 100644
--- a/cdn/src/routes/ping.ts
+++ b/src/cdn/routes/ping.ts
diff --git a/cdn/src/routes/role-icons.ts b/src/cdn/routes/role-icons.ts
index 12aae8a4..12aae8a4 100644
--- a/cdn/src/routes/role-icons.ts
+++ b/src/cdn/routes/role-icons.ts
diff --git a/cdn/src/start.ts b/src/cdn/start.ts
index 71681b40..1fdea22e 100644
--- a/cdn/src/start.ts
+++ b/src/cdn/start.ts
@@ -1,3 +1,4 @@
+require('module-alias/register')
import dotenv from "dotenv";
dotenv.config();
diff --git a/cdn/src/util/FileStorage.ts b/src/cdn/util/FileStorage.ts
index 84ecf556..955c570b 100644
--- a/cdn/src/util/FileStorage.ts
+++ b/src/cdn/util/FileStorage.ts
@@ -1,10 +1,9 @@
import { Storage } from "./Storage";
import fs from "fs";
-import fse from "fs-extra";
import { join, relative, dirname } from "path";
import "missing-native-js-functions";
import { Readable } from "stream";
-import ExifTransformer = require("exif-be-gone");
+import ExifTransformer from "exif-be-gone";
// TODO: split stored files into separate folders named after cloned route
@@ -36,7 +35,7 @@ export class FileStorage implements Storage {
async set(path: string, value: any) {
path = getPath(path);
- fse.ensureDirSync(dirname(path));
+ if (!fs.existsSync(dirname(path))) fs.mkdirSync(dirname(path));
value = Readable.from(value);
const cleaned_file = fs.createWriteStream(path);
diff --git a/cdn/src/util/S3Storage.ts b/src/cdn/util/S3Storage.ts
index c4066817..c4066817 100644
--- a/cdn/src/util/S3Storage.ts
+++ b/src/cdn/util/S3Storage.ts
diff --git a/cdn/src/util/Storage.ts b/src/cdn/util/Storage.ts
index 89dd5634..04fbacca 100644
--- a/cdn/src/util/Storage.ts
+++ b/src/cdn/util/Storage.ts
@@ -1,6 +1,6 @@
import { FileStorage } from "./FileStorage";
import path from "path";
-import fse from "fs-extra";
+import fs from "fs";
import { bgCyan, black } from "picocolors";
import { S3 } from "@aws-sdk/client-s3";
import { S3Storage } from "./S3Storage";
@@ -22,7 +22,7 @@ if (process.env.STORAGE_PROVIDER === "file" || !process.env.STORAGE_PROVIDER) {
location = path.join(process.cwd(), "files");
}
console.log(`[CDN] storage location: ${bgCyan(`${black(location)}`)}`);
- fse.ensureDirSync(location);
+ if (!fs.existsSync(location)) fs.mkdirSync(location);
process.env.STORAGE_LOCATION = location;
storage = new FileStorage();
diff --git a/cdn/src/util/index.ts b/src/cdn/util/index.ts
index 07a5c31a..07a5c31a 100644
--- a/cdn/src/util/index.ts
+++ b/src/cdn/util/index.ts
diff --git a/cdn/src/util/multer.ts b/src/cdn/util/multer.ts
index bfdf6aff..bfdf6aff 100644
--- a/cdn/src/util/multer.ts
+++ b/src/cdn/util/multer.ts
|