Skip to content

Commit

Permalink
fix hmr
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Mar 5, 2024
1 parent a3f6818 commit d33c729
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export function hmr() {
if (resourcePath.includes('/-components/')) {
return source;
}
const name = require(`${process.cwd()}/package.json`).name;
if (resourcePath.includes(`/assets/${name}.js`)) {
source += `\nimport.meta.hot.accept();`;
}
if (
resourcePath.endsWith('.hbs') ||
resourcePath.endsWith('.gjs') ||
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-vite-hmr",
"version": "0.6.4",
"version": "0.6.5",
"keywords": [
"ember-addon"
],
Expand Down

0 comments on commit d33c729

Please sign in to comment.