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