@@ -47,25 +47,31 @@ class Deployer
47
47
/** @var int */
48
48
private $ errorCount ;
49
49
50
+ /** @var \Magento\Framework\View\Asset\MinifyService */
51
+ protected $ minifyService ;
52
+
50
53
/**
51
54
* @param Files $filesUtil
52
55
* @param Deployer\Log $logger
53
56
* @param Version\StorageInterface $versionStorage
54
57
* @param \Magento\Framework\Stdlib\DateTime $dateTime
58
+ * @param \Magento\Framework\View\Asset\MinifyService $minifyService
55
59
* @param bool $isDryRun
56
60
*/
57
61
public function __construct (
58
62
Files $ filesUtil ,
59
63
Deployer \Log $ logger ,
60
64
Version \StorageInterface $ versionStorage ,
61
65
\Magento \Framework \Stdlib \DateTime $ dateTime ,
66
+ \Magento \Framework \View \Asset \MinifyService $ minifyService ,
62
67
$ isDryRun = false
63
68
) {
64
69
$ this ->filesUtil = $ filesUtil ;
65
70
$ this ->logger = $ logger ;
66
71
$ this ->versionStorage = $ versionStorage ;
67
72
$ this ->dateTime = $ dateTime ;
68
73
$ this ->isDryRun = $ isDryRun ;
74
+ $ this ->minifyService = $ minifyService ;
69
75
}
70
76
71
77
/**
@@ -193,6 +199,7 @@ private function deployFile($filePath, $area, $themePath, $locale, $module)
193
199
$ requestedPath ,
194
200
['area ' => $ area , 'theme ' => $ themePath , 'locale ' => $ locale , 'module ' => $ module ]
195
201
);
202
+ $ asset = $ this ->minifyService ->getAssets ([$ asset ], true )[0 ];
196
203
$ this ->logger ->logDebug ("\tDeploying the file to ' {$ asset ->getPath ()}' " , '. ' );
197
204
if ($ this ->isDryRun ) {
198
205
$ asset ->getContent ();
0 commit comments