Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(build): set up webpack cache
Elian Doran7f314d2d75e4
diff --git a/.gitignore b/.gitignoreindex bbfb244830..bc15756656 100644--- a/.gitignore+++ b/.gitignore@@ -1,3 +1,4 @@+.cache.DS_Storenode_modules/dist/diff --git a/src/routes/assets.ts b/src/routes/assets.tsindex e76f0fc88f..96916f85d2 100644--- a/src/routes/assets.ts+++ b/src/routes/assets.ts@@ -2,7 +2,7 @@ import assetPath from "../services/asset_path.js";import path from "path";import { fileURLToPath } from "url";import express from "express";-import { isDev } from "../services/utils.js";+import { isDev, isElectron } from "../services/utils.js";import type serveStatic from "serve-static";const persistentCacheStatic = (root: string, options?: serveStatic.ServeStaticOptions<express.Response<any, Record<string, any>>>) => {@@ -24,6 +24,12 @@ async function register(app: express.Application) {const frontendCompiler = webpack({mode: "development",+ cache: {+ type: "filesystem",+ cacheDirectory: isElectron+ ? path.join(srcRoot, "..", "..", ".cache", "electron")+ : path.join(srcRoot, "..", ".cache", "server")+ },entry: productionConfig.entry,module: productionConfig.module,resolve: productionConfig.resolve,diff --git a/src/services/in_app_help.ts b/src/services/in_app_help.tsindex c06d15bd88..0af9116844 100644--- a/src/services/in_app_help.ts+++ b/src/services/in_app_help.ts@@ -28,7 +28,6 @@ function parseNoteMetaFile(noteMetaFile: NoteMetaFile): HiddenSubtreeItem[] {const metaRoot = noteMetaFile.files[0];const parsedMetaRoot = parseNoteMeta(metaRoot, "/" + (metaRoot.dirFileName ?? ""));- console.log(JSON.stringify(parsedMetaRoot, null, 4));return parsedMetaRoot.children ?? [];}