You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CSS files that are imported via a CSS @import aren't included in preview-stats.json.
For example, if I have a component that does import './index.css' and index.css has code such as the following:
@import './my-component.css'
index.css will show up inside preview-stats.json when you run a Storybook build, but my-component.css won't.
I was doing some debugging of this issue and it seems that in the moduleParsed Rollup hook, CSS imports aren't listed in the dynamicallyImportedIds or importedIds arrays. I'm assuming this is because Vite itself is using another Rollup plugin (css-import?) to handle @import statements, so the dependency info never makes its way to vite-plugin-turbosnap.
I'm wondering if this is something that vite-plugin-turbosnap might be able to support in some way? I'm not too familiar with Rollup plugins so I'm not sure if there's maybe another hook where the CSS import info is available?
The text was updated successfully, but these errors were encountered:
s-robertson
changed the title
CSS imports aren't included in generated JSON file
CSS files imported from inside other CSS files aren't included in generated JSON file
Oct 19, 2023
CSS files that are imported via a CSS
@import
aren't included inpreview-stats.json
.For example, if I have a component that does
import './index.css'
andindex.css
has code such as the following:index.css
will show up insidepreview-stats.json
when you run a Storybook build, butmy-component.css
won't.I was doing some debugging of this issue and it seems that in the
moduleParsed
Rollup hook, CSS imports aren't listed in thedynamicallyImportedIds
orimportedIds
arrays. I'm assuming this is because Vite itself is using another Rollup plugin (css-import
?) to handle@import
statements, so the dependency info never makes its way tovite-plugin-turbosnap
.I'm wondering if this is something that
vite-plugin-turbosnap
might be able to support in some way? I'm not too familiar with Rollup plugins so I'm not sure if there's maybe another hook where the CSS import info is available?The text was updated successfully, but these errors were encountered: