diff --git a/src/Plugin.php b/src/Plugin.php index 6e2bbe5..d7c1d05 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -11,6 +11,7 @@ */ use Composer\Autoload\ClassLoader; +use Composer\Config; use Composer\Composer; use Composer\EventDispatcher\EventSubscriberInterface; use Composer\IO\IOInterface; @@ -99,7 +100,7 @@ public function onPreAutoloadDump() if ($includeFile->dump()) { $rootPackage = $this->composer->getPackage(); $autoloadDefinition = $rootPackage->getAutoload(); - $autoloadDefinition['files'][] = $includeFilePath; + $autoloadDefinition['files'][] = $this->composer->getConfig()->get('vendor-dir', Config::RELATIVE_PATHS) . self::INCLUDE_FILE; $rootPackage->setAutoload($autoloadDefinition); $this->io->writeError('helhum/dotenv-connector: Generated dotenv include file'); } else {