analogjs / analog

The fullstack meta-framework for Angular. Powered by Vite and Nitro
https://analogjs.org
MIT License
2.61k stars 251 forks source link

HMR doesn't work properly when a `base` property is set in the Vite config #1181

Closed Poiuytrezay1 closed 5 days ago

Poiuytrezay1 commented 5 months ago

Please provide the environment you discovered this bug in.

I couldn't create a stackblitz, but here is an easy way to reproduce:

Which area/package is the issue in?

vite-plugin-angular

Description

When setting a base URL in the vite config and index.html file, HMR stops working properly for HTML templates in separate files. This is annoying, as it forces us to restart the app every time.

Please provide the exception or error you saw

No response

Other information

When handling hot updates, the HTML file's importers field is missing the corresponding component.ts (thus, component.ts is not invalidated when modifying the HTML).

I would be willing to submit a PR to fix this issue

brandonroberts commented 5 days ago

Try with the latest release, and reopen if this is still an issue