fix static on prod
This commit is contained in:
parent
5bab6976ed
commit
dcf0c8ec2e
@ -212,7 +212,7 @@ HTML;
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function getFooterScriptTags(): string {
|
protected function getFooterScriptTags(): string {
|
||||||
global $config;
|
global $config, $globalContext;
|
||||||
|
|
||||||
$html = '<script type="text/javascript">';
|
$html = '<script type="text/javascript">';
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ HTML;
|
|||||||
$versions = '{}';
|
$versions = '{}';
|
||||||
else {
|
else {
|
||||||
$versions = [];
|
$versions = [];
|
||||||
foreach ($config['assets'] as $name => $v) {
|
foreach ($config['assets'][$globalContext->project] as $name => $v) {
|
||||||
list($type, $bname) = $this->getStaticNameParts($name);
|
list($type, $bname) = $this->getStaticNameParts($name);
|
||||||
$versions[$type][$bname] = $v;
|
$versions[$type][$bname] = $v;
|
||||||
}
|
}
|
||||||
@ -296,7 +296,7 @@ HTML;
|
|||||||
protected function getStaticIntegrityAttribute(string $name): string {
|
protected function getStaticIntegrityAttribute(string $name): string {
|
||||||
if (isDev())
|
if (isDev())
|
||||||
return '';
|
return '';
|
||||||
global $config;
|
global $config, $globalContext;
|
||||||
return ' integrity="'.implode(' ', array_map(fn($hash_type) => $hash_type.'-'.$config['assets'][$name]['integrity'][$hash_type], self::RESOURCE_INTEGRITY_HASHES)).'"';
|
return ' integrity="'.implode(' ', array_map(fn($hash_type) => $hash_type.'-'.$config['assets'][$globalContext->project][$name]['integrity'][$hash_type], self::RESOURCE_INTEGRITY_HASHES)).'"';
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user