Skip to content

Commit

Permalink
fixed getting config after nesting in development
Browse files Browse the repository at this point in the history
  • Loading branch information
passchn committed Jan 22, 2023
1 parent 148e517 commit a10993c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/View/Helper/ViteScriptsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function isDev(?ViteHelperConfig $config = null): bool
return false;
}

$needles = $config->read('developmentHostNeedles', ConfigDefaults::DEVELOPMENT_HOST_NEEDLES);
$needles = $config->read('development.hostNeedles', ConfigDefaults::DEVELOPMENT_HOST_NEEDLES);
foreach ($needles as $needle) {
if (Strings::contains((string)$this->getView()->getRequest()->host(), $needle)) {
return true;
Expand Down Expand Up @@ -94,7 +94,7 @@ public function script(array $options = [], ?ViteHelperConfig $config = null): v
private function devScript(array $options, ViteHelperConfig $config): void
{
$this->Html->script(
$config->read('developmentUrl', ConfigDefaults::DEVELOPMENT_URL)
$config->read('development.url', ConfigDefaults::DEVELOPMENT_URL)
. '/@vite/client',
[
'type' => 'module',
Expand All @@ -109,7 +109,7 @@ private function devScript(array $options, ViteHelperConfig $config): void
$files = $this->getFiles($config->read('development.scriptEntries', ConfigDefaults::DEVELOPMENT_SCRIPT_ENTRIES));
foreach ($files as $file) {
$this->Html->script(Text::insert(':host/:file', [
'host' => $config->read('developmentUrl', ConfigDefaults::DEVELOPMENT_URL),
'host' => $config->read('development.url', ConfigDefaults::DEVELOPMENT_URL),
'file' => ltrim($file, DS),
]), $options);
}
Expand Down

0 comments on commit a10993c

Please sign in to comment.