-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Use with Storybook #49
Comments
So I read that the upcoming version of Storybook 7 is going to use import { URL, fileURLToPath } from "url";
import { defineConfig } from "vite";
export default defineConfig({
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
}); ^ I also tested that Storybook can pick up alias resolvers when declared in the config, which it does. I prefer the style this plugin uses, and that it takes no configuration. Any ideas how to get it working with Storybook though? |
Have you tried the newest release? v0.10.0 - That mightve fixed the issue with storybook 7! |
Yeah unfortunately it was v0.10. I just set it up a few hours ago. |
Ok thanks for the update! |
I think the issue might be that |
Found a solution, so i will be working on this in the following weeks! |
Hey @Subwaytime ! What is your solution ? Ty ! |
Essentially the best and easiest way right now is to let vite-aliases write into the vite.config file itself via an option. As in |
Workaround for now would be using the generated log file and manually extending your vite.config with it |
Just got the package working for my app and it was super easy. My issue is Storybook is not finding any of the aliases. I followed the Storybook docs to use the resolvers from my config which didn't work. I'm realizing it's trying to pull directly from the vite config, which doesn't have any. I need it to read from
vite-aliases
somehow.Any ideas for how to get Storybook resolving the aliases correctly?
The text was updated successfully, but these errors were encountered: