Skip to content

Build your personal knowledge base with Trilium Notes

chore(dx/server): set up cache for Vite

Elian Doran1dcb3b15292d
diff --git a/.gitignore b/.gitignore
index 09749c2700..877dd4cb27 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,8 @@
# See https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
+/.cache
+!/.cache/vite/.gitkeep
+
# compiled output
dist
tmp
diff --git a/apps/server/src/routes/assets.ts b/apps/server/src/routes/assets.ts
index 5484e0158d..99d5fac726 100644
--- a/apps/server/src/routes/assets.ts
+++ b/apps/server/src/routes/assets.ts
@@ -23,6 +23,7 @@ async function register(app: express.Application) {
if (isDev) {
const vite = await createViteServer({
+ cacheDir: path.join(srcRoot, "../../.cache/vite"),
base: `/${assetUrlFragment}/`,
root: path.join(srcRoot, "../client"),
plugins: [