CleverCloud / clever-components

Collection of Web Components by Clever Cloud
https://www.clever-cloud.com/doc/clever-components/
Apache License 2.0
215 stars 19 forks source link

Storybook: docs are not regenerated on the fly in dev mode #989

Closed florian-sanders-cc closed 3 months ago

florian-sanders-cc commented 3 months ago

Summary

There were actually two issues:

Context

We've recently moved to vite & storybook > 7.0.

It looks like the generate-cem-vite-plugin does not work as it should. It generates the docs when launching storybook but it's not run when the doc of a component is updated (that is to say, when a component file is modified).

This seems to be related to HMR:

We may need a way to hook into HMR when a component is updated and tell vite to consider the custom-elements.json module as "invalidated" :thinking:

For more info, see: