From 6d248d5952843ea526f68c2869bd61fd2e23f62b Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 6 Jun 2016 17:09:57 +0300 Subject: [PATCH] MAGETWO-50847: [Github] setup:static-content:deploy does not create all the required static assets #2976 --- app/code/Magento/Deploy/Model/Deployer.php | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/app/code/Magento/Deploy/Model/Deployer.php b/app/code/Magento/Deploy/Model/Deployer.php index 5ce8251db1e8b..5be86504d5179 100644 --- a/app/code/Magento/Deploy/Model/Deployer.php +++ b/app/code/Magento/Deploy/Model/Deployer.php @@ -17,6 +17,8 @@ use Magento\Framework\ObjectManagerInterface; use Magento\Framework\Translate\Js\Config as JsTranslationConfig; use Symfony\Component\Console\Output\OutputInterface; +use Magento\Framework\View\Asset\Minification; +use Magento\Framework\App\ObjectManager; /** * A service for deploying Magento static view files for production mode @@ -74,6 +76,11 @@ class Deployer */ private $alternativeSources; + /** + * @var Minification + */ + private $minification; + /** * Constructor * @@ -183,6 +190,9 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales) $dictionaryFileName = $this->jsTranslationConfig->getDictionaryFileName(); $this->deployFile($dictionaryFileName, $area, $themePath, $locale, null); } + if ($this->getMinification()->isEnabled('js')) { + $fileManager->createMinResolverAsset(); + } $fileManager->clearBundleJsPool(); $this->bundleManager->flush(); $this->output->writeln("\nSuccessful: {$this->count} files; errors: {$this->errorCount}\n---\n"); @@ -213,6 +223,21 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales) return \Magento\Framework\Console\Cli::RETURN_SUCCESS; } + /** + * Get Minification instance + * + * @deprecated + * @return Minification + */ + private function getMinification() + { + if (null === $this->minification) { + $this->minification = ObjectManager::getInstance()->get(Minification::class); + } + + return $this->minification; + } + /** * Accumulate all static view files in the application and record all found areas, themes and languages *