-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin is incompatible with Storybook using [email protected] #50
Comments
I've been digging into why our example lit project has started failing in the storybook builder when updating vite to v3. One thing I've noticed so far, is that the
Which might not be what this plugin is expecting. Here's the node structure:
But, this plugin is looking for a |
It's likely caused by vitejs/vite#8278 (Vite 3) and vitejs/vite#8471 (Vite 2 backport). I'm not sure if the plugin is tapping into Vite's internals to be a regression, but the PRs were improvements to reduce hacks made in the codebase. |
Thanks for investigating @IanVS! I'll try and handle that AST format as well. |
Note The linked PRs has been reverted due to other regressions caused. See vitejs/vite#8874 |
Just for the record: adjusting default rollup-plugin-postcss-lit/index.ts Line 32 in 303e1b0
include: '**/*.{css,sss,pcss,styl,stylus,sass,scss,less}?(*)' Maybe a way to go would be to introduce an option allowing to match without query (and use it by default) |
Cool @jrencz, let's change the default |
It should, but what I meant was: instead of matching whole Additional flag/option would allow users to revert to the native way (i.e. with query) if needed. |
Is anyone still experiencing this problem? I cannot reproduce it with recent versions of |
@umbopepato I've recently had the issue when using Storybook 7.4 and rollup-plugin-postcss-lit 2.0.0. I've updated to Storybook 7.5 and rollup-plugin-postcss-lit 2.1.0 and the issue has disappeared! Thanks for fixing it! |
Awesome @sr258, thank you for the feedback! 😊 |
With vite's update to v2.9.7, the plugin's default settings no longer work when used in conjunction with @storybook/builder-vite.
A minimal reproducible example can be found here: https://github.com/troyvassalotti/storybook-vite-plugin-mre with steps on how to reproduce and the error that is happening.
It seems that Vite may have changed how CSS imports work and it is creating an issue when trying to run a Storybook dev server. This issue is related to #49. In order for the plugin to work with Storybook so we can import SASS into our Lit components, we need to specifically
include
only SASS files. We lose the option toinclude
standard CSS files after the Vite update.The text was updated successfully, but these errors were encountered: