Notes/bin/copy-trilium.sh
Panagiotis Papadopoulos cd8401089d build(copy-trilium): update list of useless deps paths
* image-q/demo -> doesn't exist anymore (and even if it did - previous cleanup step, would've removed this anyways)
* @excalidraw/excalidraw/dist/* -> updated to point to the dev folder
* boxicons -> only fonts and css folders are used, so remove the other ones
* jimp -> updated paths and removed non-existent path

fixing here for historical reasons, next step is to move these over to copy-dist.ts
2025-03-26 08:12:48 +01:00

27 lines
671 B
Bash
Executable File

#!/usr/bin/env bash
set -e # Fail on any command error
shopt -s globstar
BUILD_DIR="./build"
if ! [[ $(which npm) ]]; then
echo "Missing npm"
exit 1
fi
if [[ -d "$BUILD_DIR"/node_modules ]]; then
# cleanup of useless files in dependencies
for d in \
'@excalidraw/excalidraw/dist/dev' \
'mermaid/dist/mermaid.js' \
'boxicons/svg' 'boxicons/node_modules' 'boxicons/src' 'boxicons/iconjar' \
'@jimp/plugin-print/fonts' 'jimp/dist/browser'; do
[[ -e "$BUILD_DIR"/node_modules/"$d" ]] && rm -r "$BUILD_DIR"/node_modules/"$d"
done
fi
find $BUILD_DIR/libraries -name "*.map" -type f -delete
unset f d BUILD_DIR