Skip to content

Commit

Permalink
Do not require http_client service
Browse files Browse the repository at this point in the history
This makes it possible to use AssetMapper with `http_client` disabled on the framework.

Example:
```php
$configurator->extension(
    'framework',
    [
        'http_client' => [
            'enabled' => false,
        ],
        'asset_mapper' => [
            'paths' => [
                'assets/',
            ],
        ],
    ]
);
```
  • Loading branch information
ruudk authored and fabpot committed May 25, 2024
1 parent 055f3c1 commit 0297437
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Resources/config/asset_mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
])

->set('asset_mapper.importmap.resolver', JsDelivrEsmResolver::class)
->args([service('http_client')])
->args([service('http_client')->nullOnInvalid()])

->set('asset_mapper.importmap.renderer', ImportMapRenderer::class)
->args([
Expand All @@ -212,12 +212,12 @@
->set('asset_mapper.importmap.auditor', ImportMapAuditor::class)
->args([
service('asset_mapper.importmap.config_reader'),
service('http_client'),
service('http_client')->nullOnInvalid(),
])
->set('asset_mapper.importmap.update_checker', ImportMapUpdateChecker::class)
->args([
service('asset_mapper.importmap.config_reader'),
service('http_client'),
service('http_client')->nullOnInvalid(),
])

->set('asset_mapper.importmap.command.require', ImportMapRequireCommand::class)
Expand Down

0 comments on commit 0297437

Please sign in to comment.