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": {
|
"targets": {
|
||||||
"serve": {
|
"serve": {
|
||||||
"executor": "@nx/js:node",
|
"executor": "@nx/js:node",
|
||||||
"defaultConfiguration": "development",
|
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"build-without-client"
|
"build-without-client"
|
||||||
],
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"buildTarget": "server:build",
|
"buildTarget": "server:build-without-client:development",
|
||||||
"runBuildTargetDependencies": false
|
"runBuildTargetDependencies": false
|
||||||
},
|
|
||||||
"configurations": {
|
|
||||||
"development": {
|
|
||||||
"buildTarget": "server:build-without-client"
|
|
||||||
},
|
|
||||||
"production": {
|
|
||||||
"buildTarget": "server:build:production"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
@ -141,7 +132,7 @@
|
|||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"build"
|
"build"
|
||||||
],
|
],
|
||||||
"command": "node apps/server/dist/main.js"
|
"command": "node apps/server/dist/main.cjs"
|
||||||
},
|
},
|
||||||
"docker-build": {
|
"docker-build": {
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
@ -190,10 +181,12 @@
|
|||||||
"platform": "node",
|
"platform": "node",
|
||||||
"external": [
|
"external": [
|
||||||
"electron",
|
"electron",
|
||||||
"@electron/remote"
|
"@electron/remote",
|
||||||
|
"better-sqlite3",
|
||||||
|
"jsdom"
|
||||||
],
|
],
|
||||||
"format": [
|
"format": [
|
||||||
"esm"
|
"cjs"
|
||||||
],
|
],
|
||||||
"declarationRootDir": "apps/server/src"
|
"declarationRootDir": "apps/server/src"
|
||||||
},
|
},
|
||||||
@ -264,6 +257,5 @@
|
|||||||
},
|
},
|
||||||
"types": "./dist/main.d.ts",
|
"types": "./dist/main.d.ts",
|
||||||
"module": "./dist/main.js",
|
"module": "./dist/main.js",
|
||||||
"type": "module",
|
|
||||||
"main": "./dist/main.js"
|
"main": "./dist/main.js"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { assetUrlFragment } from "../services/asset_path.js";
|
import { assetUrlFragment } from "../services/asset_path.js";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
import express from "express";
|
import express from "express";
|
||||||
import { getResourceDir, isDev } from "../services/utils.js";
|
import { getResourceDir, isDev } from "../services/utils.js";
|
||||||
import type serveStatic from "serve-static";
|
import type serveStatic from "serve-static";
|
||||||
@ -18,7 +17,7 @@ const persistentCacheStatic = (root: string, options?: serveStatic.ServeStaticOp
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function register(app: express.Application) {
|
async function register(app: express.Application) {
|
||||||
const srcRoot = path.join(path.dirname(fileURLToPath(import.meta.url)), "..");
|
const srcRoot = path.join(__dirname, "..");
|
||||||
const resourceDir = getResourceDir();
|
const resourceDir = getResourceDir();
|
||||||
|
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
|
@ -16,7 +16,7 @@ let dayjsLocale: string;
|
|||||||
|
|
||||||
export async function initializeTranslations() {
|
export async function initializeTranslations() {
|
||||||
const resourceDir = getResourceDir();
|
const resourceDir = getResourceDir();
|
||||||
const Backend = (await import("i18next-fs-backend")).default;
|
const Backend = (await import("i18next-fs-backend/cjs")).default;
|
||||||
const locale = getCurrentLanguage();
|
const locale = getCurrentLanguage();
|
||||||
|
|
||||||
// Initialize translations
|
// Initialize translations
|
||||||
|
Loading…
x
Reference in New Issue
Block a user