From d6b422a6d028ccdb1d4fccea6b081bf72f7845e9 Mon Sep 17 00:00:00 2001 From: Ben Croker Date: Mon, 30 Dec 2024 16:22:06 -0600 Subject: [PATCH] Move set alias --- src/Datastar.php | 3 ++- src/assets/DatastarAssetBundle.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Datastar.php b/src/Datastar.php index 67883ed..ea6117a 100644 --- a/src/Datastar.php +++ b/src/Datastar.php @@ -59,7 +59,6 @@ public static function getInstance(): Datastar $module = new Datastar(self::ID); static::setInstance($module); Craft::$app->setModule(self::ID, $module); - Craft::setAlias('@putyourlightson/datastar', __DIR__); return $module; } @@ -71,6 +70,8 @@ public function init(): void { parent::init(); + Craft::setAlias('@putyourlightson/datastar', __DIR__); + $this->registerComponents(); $this->registerTwigExtension(); $this->registerScript(); diff --git a/src/assets/DatastarAssetBundle.php b/src/assets/DatastarAssetBundle.php index 5484b13..88784a9 100644 --- a/src/assets/DatastarAssetBundle.php +++ b/src/assets/DatastarAssetBundle.php @@ -10,7 +10,7 @@ class DatastarAssetBundle extends AssetBundle /** * @inheritdoc */ - public $sourcePath = __DIR__ . '/../resources/lib/datastar/' . Consts::VERSION; + public $sourcePath = '@putyourlightson/datastar/resources/lib/datastar/' . Consts::VERSION; /** * @inheritdoc