Skip to content

Commit 6d248d5

Browse files
author
Bohdan Korablov
committed
MAGETWO-50847: [Github] setup:static-content:deploy does not create all the required static assets #2976
1 parent f06e0d9 commit 6d248d5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

app/code/Magento/Deploy/Model/Deployer.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
use Magento\Framework\ObjectManagerInterface;
1818
use Magento\Framework\Translate\Js\Config as JsTranslationConfig;
1919
use Symfony\Component\Console\Output\OutputInterface;
20+
use Magento\Framework\View\Asset\Minification;
21+
use Magento\Framework\App\ObjectManager;
2022

2123
/**
2224
* A service for deploying Magento static view files for production mode
@@ -74,6 +76,11 @@ class Deployer
7476
*/
7577
private $alternativeSources;
7678

79+
/**
80+
* @var Minification
81+
*/
82+
private $minification;
83+
7784
/**
7885
* Constructor
7986
*
@@ -183,6 +190,9 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales)
183190
$dictionaryFileName = $this->jsTranslationConfig->getDictionaryFileName();
184191
$this->deployFile($dictionaryFileName, $area, $themePath, $locale, null);
185192
}
193+
if ($this->getMinification()->isEnabled('js')) {
194+
$fileManager->createMinResolverAsset();
195+
}
186196
$fileManager->clearBundleJsPool();
187197
$this->bundleManager->flush();
188198
$this->output->writeln("\nSuccessful: {$this->count} files; errors: {$this->errorCount}\n---\n");
@@ -213,6 +223,21 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales)
213223
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
214224
}
215225

226+
/**
227+
* Get Minification instance
228+
*
229+
* @deprecated
230+
* @return Minification
231+
*/
232+
private function getMinification()
233+
{
234+
if (null === $this->minification) {
235+
$this->minification = ObjectManager::getInstance()->get(Minification::class);
236+
}
237+
238+
return $this->minification;
239+
}
240+
216241
/**
217242
* Accumulate all static view files in the application and record all found areas, themes and languages
218243
*

0 commit comments

Comments
 (0)