mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
chore(server/esbuild): switch to cjs to embed deps
This commit is contained in:
parent
9ff2271423
commit
1abf1d3f60
@ -114,21 +114,12 @@
|
||||
"targets": {
|
||||
"serve": {
|
||||
"executor": "@nx/js:node",
|
||||
"defaultConfiguration": "development",
|
||||
"dependsOn": [
|
||||
"build-without-client"
|
||||
],
|
||||
"options": {
|
||||
"buildTarget": "server:build",
|
||||
"buildTarget": "server:build-without-client:development",
|
||||
"runBuildTargetDependencies": false
|
||||
},
|
||||
"configurations": {
|
||||
"development": {
|
||||
"buildTarget": "server:build-without-client"
|
||||
},
|
||||
"production": {
|
||||
"buildTarget": "server:build:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"package": {
|
||||
@ -141,7 +132,7 @@
|
||||
"dependsOn": [
|
||||
"build"
|
||||
],
|
||||
"command": "node apps/server/dist/main.js"
|
||||
"command": "node apps/server/dist/main.cjs"
|
||||
},
|
||||
"docker-build": {
|
||||
"dependsOn": [
|
||||
@ -190,10 +181,12 @@
|
||||
"platform": "node",
|
||||
"external": [
|
||||
"electron",
|
||||
"@electron/remote"
|
||||
"@electron/remote",
|
||||
"better-sqlite3",
|
||||
"jsdom"
|
||||
],
|
||||
"format": [
|
||||
"esm"
|
||||
"cjs"
|
||||
],
|
||||
"declarationRootDir": "apps/server/src"
|
||||
},
|
||||
@ -264,6 +257,5 @@
|
||||
},
|
||||
"types": "./dist/main.d.ts",
|
||||
"module": "./dist/main.js",
|
||||
"type": "module",
|
||||
"main": "./dist/main.js"
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user