Skip to content

Commit

Permalink
Merge pull request #30438 from storybookjs/shilman/30431-fix-vite-add…
Browse files Browse the repository at this point in the history
…-component-ui

Vite: Fix add component UI invalidation
(cherry picked from commit 1c7bb67)
  • Loading branch information
shilman authored and storybook-bot committed Feb 1, 2025
1 parent 915acf9 commit c9c2fd9
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 c9c2fd9

Please sign in to comment.