Skip to content

Commit

Permalink
Merge pull request #18 from ExoUNX/dev
Browse files Browse the repository at this point in the history
Manifest builder only accepts CSS and JS files now
  • Loading branch information
Gaige Lama authored Sep 18, 2019
2 parents c4e6de9 + cd642d1 commit d617d19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private static function selectAlgorithm(): string
*
* @return string
*/
private static function parseExtension(string $path): string
public static function parseExtension(string $path): string
{
return preg_replace("#\?.*#", '', pathinfo($path, PATHINFO_EXTENSION));
}
Expand Down
12 changes: 7 additions & 5 deletions src/ManifestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,13 @@ private function buildManifest(): array
$this->vasriConfig['assets']
) as $asset => $alt
) {
$manifest[$asset] = [
'sri' => $this->builder->sri($alt),
'version' => $this->builder->versioning($alt),
'alt' => $alt
];
if ($this->builder->parseExtension($asset) === 'js' || $this->builder->parseExtension($asset) === 'css') {
$manifest[$asset] = [
'sri' => $this->builder->sri($alt),
'version' => $this->builder->versioning($alt),
'alt' => $alt
];
}
}

return $manifest;
Expand Down

0 comments on commit d617d19

Please sign in to comment.