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
build(copy-dist): add further cleanupNodeModules functionality
Panagiotis Papadopoulos6749d8084bb6
diff --git a/bin/copy-dist.ts b/bin/copy-dist.tsindex 38413b1b96..9fb520907c 100644--- a/bin/copy-dist.ts+++ b/bin/copy-dist.ts@@ -87,5 +87,18 @@ function cleanupNodeModules() {.map(el => path.join(DEST_DIR, el.parentPath, el.name)).forEach(dir => fs.removeSync(dir));++ // Delete unnecessary files based on file extension+ const filterableFileExt = new Set([+ "ts",+ "map"+ ])++ nodeDir+ // TriliumNextTODO: check if we can improve this naive file ext matching+ .filter(el => el.isFile() && filterableFileExt.has(el.name.split(".").at(-1) || ""))+ .map(file => path.join(DEST_DIR, file.parentPath, file.name))+ .forEach(file => fs.removeSync(file));+}diff --git a/bin/copy-trilium.sh b/bin/copy-trilium.shindex e99bf08b92..6aea1175c3 100755--- a/bin/copy-trilium.sh+++ b/bin/copy-trilium.sh@@ -22,7 +22,5 @@ if [[ -d "$BUILD_DIR"/node_modules ]]; thenfifind $BUILD_DIR/libraries -name "*.map" -type f -delete-find $BUILD_DIR/node_modules -name "*.map" -type f -delete-find $BUILD_DIR -name "*.ts" -type f -deleteunset f d BUILD_DIR