Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
refactor: Updated how Retour's components are registered, to allow fo…
Browse files Browse the repository at this point in the history
…r overriding via plugin config ([#1989](craftcms/cms#1989)) ([#11039](craftcms/cms#11039))
  • Loading branch information
Andrew Welch committed Sep 16, 2022
1 parent cb73c6f commit c0b825d
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions src/InstantAnalytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,28 +114,31 @@ class InstantAnalytics extends Plugin
*/
public bool $hasCpSettings = true;

// Public Static Methods
// =========================================================================

/**
* @inheritdoc
*/
public function __construct($id, $parent = null, array $config = [])
public static function config(): array
{
$config['components'] = [
'ia' => IAService::class,
'commerce' => CommerceService::class,
// Register the vite service
'vite' => [
'class' => VitePluginService::class,
'assetClass' => InstantAnalyticsAsset::class,
'useDevServer' => true,
'devServerPublic' => 'http://localhost:3001',
'serverPublic' => 'http://localhost:8000',
'errorEntry' => 'src/js/app.ts',
'devServerInternal' => 'http://craft-instantanalytics-buildchain:3001',
'checkDevServer' => true,
],
return [
'components' => [
'ia' => IAService::class,
'commerce' => CommerceService::class,
// Register the vite service
'vite' => [
'class' => VitePluginService::class,
'assetClass' => InstantAnalyticsAsset::class,
'useDevServer' => true,
'devServerPublic' => 'http://localhost:3001',
'serverPublic' => 'http://localhost:8000',
'errorEntry' => 'src/js/app.ts',
'devServerInternal' => 'http://craft-instantanalytics-buildchain:3001',
'checkDevServer' => true,
],
]
];

parent::__construct($id, $parent, $config);
}

// Public Methods
Expand Down

0 comments on commit c0b825d

Please sign in to comment.