Skip to content

Commit

Permalink
Vite: Fix add component UI invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Feb 1, 2025
1 parent dca5ced commit cc7d0f5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export function codeGeneratorPlugin(options: Options): Plugin {
// TODO maybe use the stories declaration in main
if (/\.stories\.([tj])sx?$/.test(path) || /\.mdx$/.test(path)) {
// We need to emit a change event to trigger HMR
server.watcher.emit('change', SB_VIRTUAL_FILES.VIRTUAL_STORIES_FILE);
server.watcher.emit(
'change',
getResolvedVirtualModuleId(SB_VIRTUAL_FILES.VIRTUAL_STORIES_FILE)
);
}
});
},
Expand Down

0 comments on commit cc7d0f5

Please sign in to comment.