chore(server/esbuild): switch to cjs to embed deps

This commit is contained in:
Elian Doran
2025-05-23 11:56:45 +03:00
parent 9ff2271423
commit 1abf1d3f60
3 changed files with 8 additions and 17 deletions

View File

@@ -1,6 +1,5 @@
import { assetUrlFragment } from "../services/asset_path.js";
import path from "path";
import { fileURLToPath } from "url";
import express from "express";
import { getResourceDir, isDev } from "../services/utils.js";
import type serveStatic from "serve-static";
@@ -18,7 +17,7 @@ const persistentCacheStatic = (root: string, options?: serveStatic.ServeStaticOp
};
async function register(app: express.Application) {
const srcRoot = path.join(path.dirname(fileURLToPath(import.meta.url)), "..");
const srcRoot = path.join(__dirname, "..");
const resourceDir = getResourceDir();
if (isDev) {

View File

@@ -16,7 +16,7 @@ let dayjsLocale: string;
export async function initializeTranslations() {
const resourceDir = getResourceDir();
const Backend = (await import("i18next-fs-backend")).default;
const Backend = (await import("i18next-fs-backend/cjs")).default;
const locale = getCurrentLanguage();
// Initialize translations