diff --git a/bin/compile b/bin/compile index d9e0388f..a86e865f 100755 --- a/bin/compile +++ b/bin/compile @@ -495,11 +495,24 @@ if [ -n "$PHP_FPM_INCLUDES" ] ; then done fi -if [ "$PHP_BUILDPACK_NO_NODE" != "true" ] ; then - install_node_deps "$BUILD_DIR" + +# By default, we run npm first, and then Composer. +# If PHP_BUILDPACK_RUN_COMPOSER_FIRST is set to "true", we run Composer first +# and then npm. +# This is especially useful for frameworks such a symfony-ux that require +# Composer to run before npm. +if [[ "${PHP_BUILDPACK_RUN_COMPOSER_FIRST:-}" = 'true' ]]; then + install_composer_deps "${BUILD_DIR}" "${CACHE_DIR}" "${ENV_DIR}" +fi + +if [[ "${PHP_BUILDPACK_NO_NODE:-}" != "true" ]] ; then + install_node_deps "${BUILD_DIR}" +fi + +if [[ "${PHP_BUILDPACK_RUN_COMPOSER_FIRST:-}" != 'true' ]]; then + install_composer_deps "${BUILD_DIR}" "${CACHE_DIR}" "${ENV_DIR}" fi -install_composer_deps "${BUILD_DIR}" "${CACHE_DIR}" "${ENV_DIR}" # Detect PHP framework # Set FRAMEWORK if not set in environment by user