Bugfix: make vite dist path relative

This commit is contained in:
Andreas Palm 2024-04-08 12:29:41 +02:00
parent d39af1c26f
commit 761b316bdc

View File

@ -305,15 +305,15 @@ class ModuleScriptCache
if (defined('VITE_DEV_SERVER')) { if (defined('VITE_DEV_SERVER')) {
$url = 'http://' . VITE_DEV_SERVER . '/' . $module->src; $url = 'http://' . VITE_DEV_SERVER . '/' . $module->src;
} else { } else {
$url = $this->assetDir . '/' . $module->file; $url = '.'.$this->assetDir . '/' . $module->file;
if (isset($module->css)) { if (isset($module->css)) {
foreach ($module->css as $css) foreach ($module->css as $css)
$html .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $this->assetDir.'/'.$css); $html .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', '.'.$this->assetDir.'/'.$css);
$html .= "\r\n"; $html .= "\r\n";
} }
} }
} elseif (str_starts_with($module,$this->baseDir.'/www')) { } elseif (str_starts_with($module,$this->baseDir.'/www')) {
$url = substr($module, strlen($this->baseDir)+4); $url = '.'.substr($module, strlen($this->baseDir)+4);
} }
if (isset($url)) { if (isset($url)) {