Commit 417ab6c6 authored by Tino Goratsch's avatar Tino Goratsch

allow javascript files for the MinifiedAwareFileCheckerStrategy too

parent 3e8e52b8
......@@ -36,7 +36,7 @@ class FileResolver
/**
* @var array
*/
private $cachedPaths = [];
private $cachedPaths;
/**
* @var bool
*/
......
......@@ -12,7 +12,8 @@ class MinifiedAwareFileCheckerStrategy implements FileCheckerStrategyInterface
public function findResource(string $resourcePath): ?string
{
$fileExtDot = \strrpos($resourcePath, '.');
$resourcePath = \substr($resourcePath, 0, $fileExtDot) . '.min.css';
$fileExt = \substr($resourcePath, $fileExtDot + 1);
$resourcePath = \substr($resourcePath, 0, $fileExtDot) . '.min.' . $fileExt;
if (\is_file($resourcePath)) {
return $resourcePath;
......@@ -23,6 +24,6 @@ class MinifiedAwareFileCheckerStrategy implements FileCheckerStrategyInterface
public function isAllowed(string $resourcePath): bool
{
return (bool) \preg_match('/.+(?<!\.min)\.css$/', $resourcePath);
return (bool) \preg_match('/.+(?<!\.min)\.(css|js)$/', $resourcePath);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment