mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2025-03-27 15:50:22 +01:00
commit
3bcbafeef3
@ -221,12 +221,7 @@ class ModuleScriptCache
|
|||||||
$realPath = realpath($this->baseDir . '/' . $file);
|
$realPath = realpath($this->baseDir . '/' . $file);
|
||||||
if (!is_file($realPath))
|
if (!is_file($realPath))
|
||||||
continue;
|
continue;
|
||||||
$this->javascriptModules[] = $file; continue;
|
$this->javascriptModules[] = $file;
|
||||||
|
|
||||||
if (isset($this->assetManifest->$file))
|
|
||||||
$this->javascriptModules[] = $this->assetManifest->$file;
|
|
||||||
else
|
|
||||||
$this->javascriptModules[] = $realPath;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,29 +311,6 @@ class ModuleScriptCache
|
|||||||
}
|
}
|
||||||
|
|
||||||
return join("\n", $tags);
|
return join("\n", $tags);
|
||||||
|
|
||||||
foreach ($this->javascriptModules as $module) {
|
|
||||||
if (is_object($module)) {
|
|
||||||
if (defined('VITE_DEV_SERVER')) {
|
|
||||||
$url = 'http://' . VITE_DEV_SERVER . '/' . $module->src;
|
|
||||||
} else {
|
|
||||||
$url = '.'.$this->assetDir . '/' . $module->file;
|
|
||||||
if (isset($module->css)) {
|
|
||||||
foreach ($module->css as $css)
|
|
||||||
$html .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', '.'.$this->assetDir.'/'.$css);
|
|
||||||
$html .= "\r\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif (str_starts_with($module,$this->baseDir.'/www')) {
|
|
||||||
$url = '.'.substr($module, strlen($this->baseDir)+4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($url)) {
|
|
||||||
$html .= sprintf('<script type="module" src="%s"></script>', $url);
|
|
||||||
$html .= "\r\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $html;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private array $renderedCss = [];
|
private array $renderedCss = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user