diff --git a/src/Bridges/Nette/WebLoaderExtension.php b/src/Bridges/Nette/WebLoaderExtension.php index fabeaef..70ccce0 100644 --- a/src/Bridges/Nette/WebLoaderExtension.php +++ b/src/Bridges/Nette/WebLoaderExtension.php @@ -89,18 +89,20 @@ private function setupTracyPanel() private function setupWebLoader() { + $arguments = [$this->config['outputDir']]; + + if ($this->config['documentRoot']) { + $arguments[] = $this->config['documentRoot']; + } + $webLoader = $this->builder->addDefinition($this->prefix(self::ENGINE_PREFIX)) ->setFactory(self::ENGINE_CLASSNAME) - ->setArguments([$this->config['outputDir']]); + ->setArguments($arguments); if ($this->config['disableCache']) { $webLoader->addSetup('disableCache'); } - if ($this->config['documentRoot']) { - $webLoader->addSetup('setDocumentRoot', [$this->config['documentRoot']]); - } - if ($this->config['filesCollections']) { $webLoader->addSetup('createFilesCollectionsFromArray', [$this->config['filesCollections']]); }