Skip to content

Commit

Permalink
Update provider to add .io on jspm (following the importmap-rails)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonysm committed Feb 3, 2024
1 parent afef360 commit 8ddc1ed
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Packager.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function import(array $packages, string $env, string $from)
'install' => $packages,
'flattenScope' => true,
'env' => ['browser', 'module', $env],
'provider' => $from,
'provider' => $this->normalizeProvider($from),
]);

return match ($response->status()) {
Expand Down Expand Up @@ -140,4 +140,12 @@ private function handleFailureResponse(Response $response)

throw Exceptions\ImportmapException::withUnexpectedResponseCode($response->status());
}

private function normalizeProvider(string $provider): string
{
return match ($provider) {
'jspm' => 'jspm.io',
default => $provider,
};
}
}

0 comments on commit 8ddc1ed

Please sign in to comment.