From b0bdb64c4561b62e79e7c3b88a7603c1464766c5 Mon Sep 17 00:00:00 2001 From: Ihor Aleksandrychiev Date: Fri, 24 Oct 2025 12:13:12 +0300 Subject: [PATCH] Removed node_modules after build Ticket: ENT-13273 Signed-off-by: Ihor Aleksandrychiev --- build-scripts/bootstrap-tarballs | 4 ++-- ci/setup-projects.sh | 5 +++-- packaging/common/cfengine-hub/postinstall.sh | 3 --- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/build-scripts/bootstrap-tarballs b/build-scripts/bootstrap-tarballs index bf3b12c9d..8f3c11a64 100755 --- a/build-scripts/bootstrap-tarballs +++ b/build-scripts/bootstrap-tarballs @@ -137,8 +137,8 @@ log_debug "Installing javascript npm dependencies..." run_and_print_on_failure npm ci --prefix "$BASEDIR"/mission-portal/public/scripts/ # build react components run_and_print_on_failure npm run build --prefix "$BASEDIR"/mission-portal/public/scripts/ - # remove the packages specified in devDependencies - run_and_print_on_failure npm prune --omit=dev --prefix "$BASEDIR"/mission-portal/public/scripts/ + # remove node_modules since the bundles are already built + run_and_print_on_failure rm -rf "$BASEDIR"/mission-portal/public/scripts/node_modules fi ) diff --git a/ci/setup-projects.sh b/ci/setup-projects.sh index b612f7822..aa77b362e 100755 --- a/ci/setup-projects.sh +++ b/ci/setup-projects.sh @@ -16,8 +16,9 @@ if test -f "mission-portal/public/scripts/package.json"; then npm ci # build react components npm run build - # remove the packages specified in devDependencies - npm prune --omit=dev + # remove node_modules since the bundles are already built + # we do not need them to be presented in the package + rm -rf node_modules fi ) diff --git a/packaging/common/cfengine-hub/postinstall.sh b/packaging/common/cfengine-hub/postinstall.sh index 69331397e..8d26c6036 100644 --- a/packaging/common/cfengine-hub/postinstall.sh +++ b/packaging/common/cfengine-hub/postinstall.sh @@ -997,10 +997,7 @@ chmod 0700 -R $PREFIX/httpd/htdocs/ldap/config # changed permissions and owner of PHP and JS dependencies chown root:$MP_APACHE_USER -R $PREFIX/httpd/htdocs/vendor -chown root:$MP_APACHE_USER -R $PREFIX/httpd/htdocs/public/scripts/node_modules - chmod -R ug=rX,o= $PREFIX/httpd/htdocs/vendor # 440 for files, 550 for dirs -chmod -R ug=rX,o= $PREFIX/httpd/htdocs/public/scripts/node_modules ## # Start Apache server (and php-fpm if present)