diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 88a2f5a89a804..610c64b7c3327 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -384,7 +384,10 @@ private function findStylesheetFiles(array $styles): array { public function getAppNamefromPath(string $path): string|false { if ($path !== '') { $pathParts = explode('/', $path); - if ($pathParts[0] === 'css') { + if ($pathParts[0] === 'dist') { + // Return the part before the dash in the file name + return explode('-', \end($pathParts), 2)[0]; + } elseif ($pathParts[0] === 'css') { // This is a scss request return $pathParts[1]; } elseif ($pathParts[0] === 'core') {