How to add path aliases to multiple workspaces in webpack configuration? #24264
Unanswered
nareshbhatia
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using a single storybook inside a monorepo (Turborepo) to display components from multiple workspaces. Storybook is setup in the main app which is a nextjs app. Here's
.storybook/main.ts
(notice multiple path aliases underwebpackFinal
):However, this is not working – Storybook gives errors whenever it encounters imports from paths like this
@/components
. If I put the same aliases in thetsconfig.json
for this workspace, Storybook starts working. See below:I don't want to do use this approach just to make storybook work – general compilation of this workspace does not reference source from other workspaces. Shouldn't the webpack configuration in
.storybook/main.ts
just work? Please help.Beta Was this translation helpful? Give feedback.
All reactions