Skip to content

Commit

Permalink
storefront(6.6): improve storefront watcher bootstrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim authored Jan 23, 2024
1 parent b27be5f commit 7c1963d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion shopware/storefront/6.6/bin/watch-storefront.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"

export PROJECT_ROOT="${PROJECT_ROOT:-"$(dirname "$CWD")"}"
export ENV_FILE=${ENV_FILE:-"${PROJECT_ROOT}/.env"}
export NPM_CONFIG_FUND=false
export NPM_CONFIG_AUDIT=false
export NPM_CONFIG_UPDATE_NOTIFIER=false

# shellcheck source=functions.sh
source "${PROJECT_ROOT}/bin/functions.sh"
Expand All @@ -23,6 +26,16 @@ export PROXY_URL
export STOREFRONT_ASSETS_PORT
export STOREFRONT_PROXY_PORT

if [[ -e "${PROJECT_ROOT}/vendor/shopware/platform" ]]; then
STOREFRONT_ROOT="${STOREFRONT_ROOT:-"${PROJECT_ROOT}/vendor/shopware/platform/src/Storefront"}"
else
STOREFRONT_ROOT="${STOREFRONT_ROOT:-"${PROJECT_ROOT}/vendor/shopware/storefront"}"
fi

if [[ ! -d "${STOREFRONT_ROOT}"/Resources/app/storefront/node_modules/webpack-dev-server ]]; then
npm --prefix "${STOREFRONT_ROOT}"/Resources/app/storefront install --prefer-offline
fi

DATABASE_URL="" "${CWD}"/console feature:dump
"${CWD}"/console theme:compile --active-only
"${CWD}"/console theme:dump
Expand Down Expand Up @@ -55,4 +68,4 @@ else
echo "Cannot check extensions for required npm installations as jq is not installed"
fi

npm --prefix vendor/shopware/storefront/Resources/app/storefront/ run-script hot-proxy
npm --prefix "${STOREFRONT_ROOT}"/Resources/app/storefront run-script hot-proxy

0 comments on commit 7c1963d

Please sign in to comment.