Skip to content

Build your personal knowledge base with Trilium Notes

fix(server/esbuild): assets not copied in prod build

Elian Doran8cf4040ca061
diff --git a/.nxignore b/.nxignore
index 7290b55e62..6c71a87587 100644
--- a/.nxignore
+++ b/.nxignore
@@ -1,2 +1,6 @@
_regroup
-_regroup_monorepo
\ No newline at end of file
+_regroup_monorepo
+
+# Asset copying respects .gitignore / .nxignore for some reason.
+# See https://github.com/nrwl/nx/issues/20309
+!dist
\ No newline at end of file
diff --git a/apps/server/package.json b/apps/server/package.json
index c676f0f1c0..90d2bdedc4 100644
--- a/apps/server/package.json
+++ b/apps/server/package.json
@@ -188,13 +188,6 @@
"outputFileName": "main.js",
"tsConfig": "apps/server/tsconfig.app.json",
"platform": "node",
- "assets": [
- {
- "glob": "**/*",
- "input": "apps/server/src/assets",
- "output": "assets"
- }
- ],
"format": [
"esm"
],
@@ -202,10 +195,29 @@
},
"configurations": {
"development": {
- "minify": false
+ "minify": false,
+ "assets": [
+ {
+ "glob": "**/*",
+ "input": "apps/server/src/assets",
+ "output": "assets"
+ }
+ ]
},
"production": {
- "minify": true
+ "minify": true,
+ "assets": [
+ {
+ "glob": "**/*",
+ "input": "apps/server/src/assets",
+ "output": "assets"
+ },
+ {
+ "glob": "**/*",
+ "input": "apps/client/dist",
+ "output": "public"
+ }
+ ]
}
}
}