Skip to content

Commit

Permalink
Merge branch 'release/1.0.32' into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jan 25, 2023
2 parents 8ba2a70 + e5a9d09 commit 57835a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Plugin Vite Changelog

## 1.0.32 - 2023.01.25
### Changed
* Updated the `craft.vite.asset()` function to work with Vite 3.x or later, where assets are stored as top-level entries in the `manifest.json` ([#56](https://github.com/nystudio107/craft-vite/issues/56)) ([#31](https://github.com/nystudio107/craft-vite/issues/31))
* You can now include CSS manually if it's a top-level entry in your `vite.config.js` (rather than being imported into your JavaScript) via `craft.vite.asset("src/css/app.css")` ([#31](https://github.com/nystudio107/craft-vite/issues/31))

## 1.0.31 - 2022.11.08
### Changed
* Allow setting the `manifestPath` automatically based on the AssetBundle for all requests, not just CP requests
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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.31",
"version": "1.0.32",
"keywords": [
"craftcms",
"plugin",
Expand Down
6 changes: 5 additions & 1 deletion src/services/ViteService.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,11 @@ public function manifestAsset(string $path): string
}
}

return '';
// With Vite 3.x or later, the assets are also included as top-level entries in the
// manifest, so check there, too
$entry = ManifestHelper::extractEntry($path);

return $entry === '' ? '' : FileHelper::createUrl($this->serverPublic, $entry);
}

/**
Expand Down

0 comments on commit 57835a7

Please sign in to comment.