IMPR: File path

This commit is contained in:
Tony Air 2022-04-13 16:40:33 +02:00
parent d980a712c5
commit afb39c8b22

View File

@ -122,7 +122,7 @@ class DeferredRequirements implements TemplateGlobalProvider
self::loadJS($projectName.'_'.$curr_class . '.js'); self::loadJS($projectName.'_'.$curr_class . '.js');
} }
// App libs // App libs
if (!$config['nofontawesome']) { if (!$config['nofontawesome']) {
$v = !isset($config['fontawesome_version']) || !$config['fontawesome_version'] $v = !isset($config['fontawesome_version']) || !$config['fontawesome_version']
? Config::inst()->get(FontAwesomeField::class, 'version') ? Config::inst()->get(FontAwesomeField::class, 'version')
@ -215,7 +215,16 @@ class DeferredRequirements implements TemplateGlobalProvider
return $url; return $url;
} }
$path = WebpackTemplateProvider::toPublicPath($url); $projectName = WebpackTemplateProvider::projectName();
$path = Path::join(
Director::publicFolder(),
RESOURCES_DIR,
$projectName,
'client',
'dist',
(strpos($url, '.js') ? 'js' : 'css'),
$url
);
$absolutePath = Director::getAbsFile($path); $absolutePath = Director::getAbsFile($path);
$hash = sha1_file($absolutePath); $hash = sha1_file($absolutePath);