Skip to content

Build your personal knowledge base with Trilium Notes

chore(monorepo/electron): invoke copy-dist

Elian Doran27465275f680
diff --git a/apps/electron/.gitignore b/apps/electron/.gitignore
index 6320cd248d..aaa22758ec 100644
--- a/apps/electron/.gitignore
+++ b/apps/electron/.gitignore
@@ -1 +1,2 @@
+build
data
\ No newline at end of file
diff --git a/apps/electron/package.json b/apps/electron/package.json
index b9a6710f75..592b80bb20 100644
--- a/apps/electron/package.json
+++ b/apps/electron/package.json
@@ -20,7 +20,8 @@
"main": "index.js",
"scripts": {
"start": "cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev electron ./src/electron-main.ts --inspect=5858 .",
- "postinstall": "electron-rebuild"
+ "postinstall": "electron-rebuild",
+ "build:copy-dist": "tsx ./scripts/copy-dist.ts"
},
"dependencies": {
"better-sqlite3": "^11.9.1",
@@ -31,6 +32,7 @@
"devDependencies": {
"@types/electron-squirrel-startup": "1.0.2",
"electron": "35.1.5",
- "@electron/rebuild": "3.7.2"
+ "@electron/rebuild": "3.7.2",
+ "tsx": "4.19.3"
}
}
diff --git a/apps/electron/scripts/copy-dist.ts b/apps/electron/scripts/copy-dist.ts
index 3b43ad3656..320fd9b13e 100644
--- a/apps/electron/scripts/copy-dist.ts
+++ b/apps/electron/scripts/copy-dist.ts
@@ -12,6 +12,14 @@ function log(...args: any[]) {
}
try {
+ /**
+ * Copy the server.
+ */
+ fs.copySync("../server/build", DEST_DIR);
+
+ /**
+ * Copy assets.
+ */
const assetsToCopy = new Set([
"./forge.config.cjs",
"./bin/electron-forge/desktop.ejs",