Skip to content

Commit

Permalink
Skip axios installation
Browse files Browse the repository at this point in the history
  • Loading branch information
tonysm committed Mar 13, 2024
1 parent 87bc0f0 commit c77bb16
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ private function importDependenciesFromNpm(): void

$dependencies = collect(array_replace($packageJson['dependencies'] ?? [], $packageJson['devDependencies'] ?? []))
->filter(fn ($_version, $package) => ! in_array($package, $filteredOutDependencies))
->filter(function ($_version, $package) {
if ($package !== 'axios') {
return true;
}

$this->output->warning('It seems you are using axios. Axios is not compatible with importmaps, so we are skipping its installation.');

return false;
})
// Axios has an issue with importmaps, so we'll hardcode the version for now...
->map(fn ($version, $package) => $package === 'axios' ? 'axios@0.27' : "\"{$package}@{$version}\"");

Expand Down

0 comments on commit c77bb16

Please sign in to comment.