From 408a0de4f0d22ecc303c50d5a0cab8c27a503df7 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 20 Apr 2021 20:18:22 -0400 Subject: [PATCH] appimage: remove node_modules from appdir The node modules do not need to be deliverer with the appimage. Removing them from the AppDir saves 50MB. --- appimage/build_appimage.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/appimage/build_appimage.sh b/appimage/build_appimage.sh index d4c6b6251..2edc0d15c 100755 --- a/appimage/build_appimage.sh +++ b/appimage/build_appimage.sh @@ -179,13 +179,21 @@ generate_ssl_cert() { } build_frontend() { - pushd "$ISLAND_PATH/cc/ui" || handle_error - npm install sass-loader node-sass webpack --save-dev - npm update + pushd "$ISLAND_PATH/cc/ui" || handle_error + npm install sass-loader node-sass webpack --save-dev + npm update - log_message "Generating front end" - npm run dist - popd || handle_error + log_message "Generating front end" + npm run dist + popd || handle_error + + remove_node_modules +} + +remove_node_modules() { + # Node has served its purpose. We don't need to deliver the node modules with + # the AppImage. + rm -rf "$ISLAND_PATH"/cc/ui/node_modules } add_monkey_icon() {