Skip to content

Commit

Permalink
MAGETWO-50847: [Github] setup:static-content:deploy does not create a…
Browse files Browse the repository at this point in the history
…ll the required static assets #2976
  • Loading branch information
Bohdan Korablov committed Jun 6, 2016
1 parent f06e0d9 commit 6d248d5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions app/code/Magento/Deploy/Model/Deployer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -74,6 +76,11 @@ class Deployer
*/
private $alternativeSources;

/**
* @var Minification
*/
private $minification;

/**
* Constructor
*
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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
*
Expand Down

0 comments on commit 6d248d5

Please sign in to comment.