diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 4d5580060931a..a42e93b6871ed 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -380,7 +380,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') {