diff --git a/CHANGELOG.md b/CHANGELOG.md index cb70770..db9d79d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Plugin Vite Changelog +## 1.0.17 - 2021.12.14 +### Fixed +* Fixed an issue where the needle/haystack logic was reversed in `strpos()` which could cause it to not match properly in some setups ([#5](https://github.com/nystudio107/craft-plugin-vite/pull/5)) + +## 1.0.16 - 2021.10.28 +### Changed +* refactor(manifest): No longer search `dynamicImports` for CSS to extract, since the Vite loader takes care of that for us ([#2](https://github.com/nystudio107/craft-plugin-vite/pull/2)) + ## 1.0.15 - 2021.10.21 ### Fixed * Fixed an issue with potentially duplicated `modulepreload` links by adding tags via an associative array ([#16](https://github.com/nystudio107/craft-vite/issues/16)) diff --git a/composer.json b/composer.json index c8cc838..f3915d7 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "nystudio107/craft-plugin-vite", "description": "Plugin Vite is the conduit between Craft CMS plugins and Vite, with manifest.json & HMR support", - "version": "1.0.15", + "version": "1.0.17", "keywords": [ "craftcms", "plugin", diff --git a/src/helpers/ManifestHelper.php b/src/helpers/ManifestHelper.php index 19fb753..7ba7c48 100644 --- a/src/helpers/ManifestHelper.php +++ b/src/helpers/ManifestHelper.php @@ -146,7 +146,7 @@ public static function extractManifestTags(string $path, bool $asyncCss = true, continue; } // If the $path isn't in the $manifestKey, skip it - if (strpos($path, $manifestKey) === false) { + if (strpos($manifestKey, $path) === false) { continue; } // Include the entry script @@ -263,7 +263,7 @@ protected static function extractCssFiles(array $manifest, string $manifestKey, return []; } $cssFiles = array_merge($cssFiles, $entry['css'] ?? []); - $imports = array_merge($entry['imports'] ?? [], $entry['dynamicImport'] ?? []); + $imports = $entry['imports'] ?? []; foreach ($imports as $import) { self::extractCssFiles($manifest, $import, $cssFiles); }