40 private $deploymentConfig;
60 parent::__construct($resolver);
68 return \Magento\Framework\View\Design\Fallback\RulePool::TYPE_TEMPLATE_FILE;
82 $template = parent::getFile($area, $themeModel, $file, $module);
84 if (
$template && $this->assetConfig->isMinifyHtml()) {
85 switch ($this->appState->getMode()) {
87 return $this->getMinifiedTemplateInProduction(
$template);
89 return $this->templateMinifier->getMinified(
$template);
108 private function getMinifiedTemplateInProduction(
$template)
110 $forceMinification = $this->deploymentConfig->getConfigData(Constants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION)
111 || $this->deploymentConfig->getConfigData(Constants::CONFIG_PATH_FORCE_HTML_MINIFICATION);
113 return $forceMinification ?
114 $this->templateMinifier->getMinified(
$template)
115 : $this->templateMinifier->getPathToMinified(
$template);
getFile($area, ThemeInterface $themeModel, $file, $module=null)
__construct(ResolverInterface $resolver, MinifierInterface $templateMinifier, State $appState, ConfigInterface $assetConfig, DeploymentConfig $deploymentConfig=null)