Skip to content

Commit

Permalink
fix(vite-plugin-angular): fix component HMR with angular 19.1.2 (#1563)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattlewis92 authored Jan 21, 2025
1 parent 05ccf37 commit ee58f28
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"ng-packagr": "^19.0.0",
"nitropack": "^2.10.0",
"nx": "20.1.2",
"playwright": "^1.30.0",
"playwright": "^1.49.1",
"postcss": "^8.4.21",
"postcss-import": "~15.1.0",
"postcss-preset-env": "~8.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/vite-plugin-angular/src/lib/angular-vite-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export function angular(options?: PluginOptions): Plugin[] {
return;
}

if (!req.url.startsWith(ANGULAR_COMPONENT_PREFIX)) {
if (!req.url.includes(ANGULAR_COMPONENT_PREFIX)) {
next();

return;
Expand Down Expand Up @@ -489,7 +489,7 @@ export function angular(options?: PluginOptions): Plugin[] {
if (
pluginOptions.liveReload &&
options?.ssr &&
id.startsWith(ANGULAR_COMPONENT_PREFIX)
id.includes(ANGULAR_COMPONENT_PREFIX)
) {
const requestUrl = new URL(id.slice(1), 'http://localhost');
const componentId = requestUrl.searchParams.get('c');
Expand Down
32 changes: 21 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ee58f28

Please sign in to comment.