From 000b66858127788c1efb0ce48cd40879c3e991ec Mon Sep 17 00:00:00 2001 From: Jonathan Visser Date: Mon, 2 Feb 2026 17:59:40 +0100 Subject: [PATCH] Add enableHighPerformanceStaticDeploy option in Magento2 application template --- src/ApplicationTemplate/Magento2.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/ApplicationTemplate/Magento2.php b/src/ApplicationTemplate/Magento2.php index 54f274d..653f541 100644 --- a/src/ApplicationTemplate/Magento2.php +++ b/src/ApplicationTemplate/Magento2.php @@ -80,4 +80,26 @@ public function setMagentoBackendThemes(array $themes): void $this->setVariable('magento_themes_backend', $themes); $this->setVariable('split_static_deployment', true); } + + /** + * Enable high-performance static content deployment using elgentos/magento2-static-deploy. + * + * This uses a Go-based static content deployer that is 230-380x faster than the native + * Magento setup:static-content:deploy command. It automatically handles both Hyvä themes + * (using fast Go deployment) and Luma themes (dispatching to bin/magento). + * + * Requirements: + * - Themes must be set using setMagentoThemes() with locale mapping (e.g., ['Vendor/theme' => 'nl_NL en_US']) + * + * @param bool $enabled Whether to enable high-performance static deployment (default: true) + * @param string $version Version of magento2-static-deploy to use (default: 'latest') + * @see https://github.com/elgentos/magento2-static-deploy + */ + public function enableHighPerformanceStaticDeploy(bool $enabled = true, string $version = 'latest'): self + { + $this->setVariable('high_performance_static_deploy', $enabled); + $this->setVariable('high_performance_static_deploy_version', $version); + + return $this; + } }