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
Is your feature request related to a problem? Please describe.
Currently, alias resolution doesn't work in MDX. As I understand, MDX files are processed by mdx2-csf which uses Babel internally, while Storybook's builders (like Vite or Webpack) rely on their respective compilers. This difference may cause Vite's configured path aliases to be ignored during the MDX transformation process. When importing components or modules using aliases (e.g., @components/Button), the compiler fails to resolve these paths correctly, leading to broken imports in Storybook.
Describe the solution you'd like
It would be helpful to clarify whether alias resolution should happen at the mdx2-csf level during the MDX transformation process or if it would be more appropriate for Storybook's builder (Vite/Webpack) to handle it during the build phase. This could involve leveraging Vite's internal resolver or providing an option to pass Vite's configuration directly to mdx2-csf.
Describe alternatives you've considered
Using absolute paths instead of aliases, which reduces code clarity and increases maintenance overhead.
Additional context
This issue impacts workflows where Vite's alias feature is heavily used for cleaner and more maintainable imports. Ensuring compatibility would streamline integration and reduce the need for workarounds. This feature is especially relevant in monorepos or projects with complex directory structures.
Thank you for considering this enhancement!
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, alias resolution doesn't work in MDX. As I understand, MDX files are processed by
mdx2-csf
which uses Babel internally, while Storybook's builders (like Vite or Webpack) rely on their respective compilers. This difference may cause Vite's configured path aliases to be ignored during the MDX transformation process. When importing components or modules using aliases (e.g.,@components/Button
), the compiler fails to resolve these paths correctly, leading to broken imports in Storybook.Describe the solution you'd like
It would be helpful to clarify whether alias resolution should happen at the
mdx2-csf
level during the MDX transformation process or if it would be more appropriate for Storybook's builder (Vite/Webpack) to handle it during the build phase. This could involve leveraging Vite's internal resolver or providing an option to pass Vite's configuration directly tomdx2-csf
.Describe alternatives you've considered
Additional context
This issue impacts workflows where Vite's alias feature is heavily used for cleaner and more maintainable imports. Ensuring compatibility would streamline integration and reduce the need for workarounds. This feature is especially relevant in monorepos or projects with complex directory structures.
Thank you for considering this enhancement!
The text was updated successfully, but these errors were encountered: