mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
feat(build): set up webpack cache
This commit is contained in:
parent
61b7d887cc
commit
7f314d2d75
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
.cache
|
||||
.DS_Store
|
||||
node_modules/
|
||||
dist/
|
||||
|
@ -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,
|
||||
|
@ -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 ?? [];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user