From da289f56eef23bc36abfab0d7eb0f553d5b9e085 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 3 Apr 2024 13:21:27 +0200 Subject: [PATCH] Fix Storybook build --- .changelog/1362.internal.md | 1 + .storybook/main.ts | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 .changelog/1362.internal.md diff --git a/.changelog/1362.internal.md b/.changelog/1362.internal.md new file mode 100644 index 000000000..211252adb --- /dev/null +++ b/.changelog/1362.internal.md @@ -0,0 +1 @@ +Fix Storybook build diff --git a/.storybook/main.ts b/.storybook/main.ts index 2457b977e..083cad3db 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -1,5 +1,8 @@ +import path from 'path' import type { StorybookConfig } from '@storybook/react-webpack5' +const appSource = path.resolve(__dirname, '../src/app') + const config: StorybookConfig = { stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'], staticDirs: ['./public'], @@ -41,6 +44,14 @@ const config: StorybookConfig = { webpackFinal: async config => { return { ...config, + resolve: { + ...config.resolve, + alias: { + ...config.resolve?.alias, + 'app/hooks': path.resolve(appSource, 'hooks'), + 'app/components': path.resolve(appSource, 'components'), + }, + }, module: { ...config.module, unknownContextCritical: false,