8000 [AssetMapper] Only download a CSS file if it is explicitly advertised by weaverryan · Pull Request #52524 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[AssetMapper] Only download a CSS file if it is explicitly advertised #52524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[AssetMapper] Only download a CSS file if it is explicitly advertised
  • Loading branch information
weaverryan committed Nov 10, 2023
commit 1f41d673f779d31e42caa09e34cc3008cb2c8680
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ public function resolvePackages(array $packagesToRequire): array

$entrypoints = $cssEntrypointResponse->toArray()['entrypoints'] ?? [];
$cssFile = $entrypoints['css']['file'] ?? null;
$guessed = $entrypoints['css']['guessed'] ?? true;

if (!$cssFile) {
if (!$cssFile || $guessed) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public static function provideResolvePackagesTests(): iterable
[
'url' => '/v1/packages/npm/bootstrap@5.2.0/entrypoints',
'response' => ['body' => ['entrypoints' => [
'css' => ['file' => '/dist/css/bootstrap.min.css'],
'css' => ['file' => '/dist/css/bootstrap.min.css', 'guessed' => false],
]]],
],
[
Expand Down
0