-
Notifications
You must be signed in to change notification settings - Fork 508
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
change rootDir to ./src cause trouble for storybook custom /.storybook/config.ts
with require.context (Storybook <5.3)
#641
Comments
Poop, thought this might be an issue after working on #638 which is very similar, but this is on the Storybook side, not the TSDX side. Was mentioned in #440 (comment) . Currently working on it but I think there's a workaround that seems to be safe, which is to use: {
"rootDirs": ["./src", "./stories", "./.storybook"]
} Storybook seems to recommend a similar set-up |
@agilgur5 confirmed, workaround works well! |
That's great, thanks for confirming! I did a lot of research and there's some discussion in #638, which is closely related to this -- there will be some changes to the templates, but I'm not sure if we'll use this specific one yet; we might be able to work it out a different way. |
So I tried reproducing this and was unable to do this with The Storybook config you're using in |
/.storybook/config.ts
)
/.storybook/config.ts
)/.storybook/config.ts
/.storybook/config.ts
/.storybook/config.ts
with require.context
Ah, I figured it out -- your configuration is for Storybook 5.2 -- the templates use 5.3 (as of TSDX v0.13), which is a big change. In 5.3 you don't need See the Storybook 5.3 migration guide or TSDX's newer templates |
/.storybook/config.ts
with require.context/.storybook/config.ts
with require.context (Storybook <5.3)
Current Behavior
after receiving the warning to tell me changge the rootDir to ./src, the stroybook does not work no longer.
Expected behavior
storybook works after changing the rootDir
Suggested solution(s)
Additional context
Your environment
The text was updated successfully, but these errors were encountered: