From 44034f6e56e7ae3b3b773b21fb38a6f5edd9e9e3 Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Thu, 12 Dec 2024 15:49:58 -0500 Subject: [PATCH] fix: set webpack environment variables. This will hopefully fix some issues we're seeing in building static assets. --- .../roles/edxapp/templates/edx/bin/edxapp-update-assets.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/playbooks/roles/edxapp/templates/edx/bin/edxapp-update-assets.j2 b/playbooks/roles/edxapp/templates/edx/bin/edxapp-update-assets.j2 index 1d7a9c65a21..f1ab34df6d4 100644 --- a/playbooks/roles/edxapp/templates/edx/bin/edxapp-update-assets.j2 +++ b/playbooks/roles/edxapp/templates/edx/bin/edxapp-update-assets.j2 @@ -4,6 +4,9 @@ {% for override in edxapp_staticfiles_storage_overrides %} sudo -E -H -u {{ edxapp_user }} \ env "PATH=$PATH" \ + "WEBPACK_CONFIG_PATH=webpack.prod.config.js" \ + "STATIC_ROOT_LMS=/edx/var/edxapp/staticfiles" \ + "STATIC_ROOT_CMS=/edx/var/edxapp/staticfiles/studio" \ npm install \ && npm run webpack \ && npm run compile-sass -- --theme-dir /edx/var/edx-themes/edx-themes/edx-platform --theme-dir /edx/app/edxapp/edx-platform/themes \ @@ -13,6 +16,9 @@ sudo -E -H -u {{ edxapp_user }} \ {% else %} sudo -E -H -u {{ edxapp_user }} \ env "PATH=$PATH" \ + "WEBPACK_CONFIG_PATH=webpack.prod.config.js" \ + "STATIC_ROOT_LMS=/edx/var/edxapp/staticfiles" \ + "STATIC_ROOT_CMS=/edx/var/edxapp/staticfiles/studio" \ npm install \ && npm run webpack \ && npm run compile-sass -- --theme-dir /edx/var/edx-themes/edx-themes/edx-platform --theme-dir /edx/app/edxapp/edx-platform/themes \