From b01b0d03dd3b866c060869edf49ece866ec17cbf Mon Sep 17 00:00:00 2001 From: Paul Schultz Date: Tue, 28 Jan 2025 13:20:35 -0600 Subject: [PATCH] fix canon storybook config Signed-off-by: Paul Schultz --- packages/canon/.storybook/main.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/canon/.storybook/main.ts b/packages/canon/.storybook/main.ts index 8bd28db556..e58c0f182f 100644 --- a/packages/canon/.storybook/main.ts +++ b/packages/canon/.storybook/main.ts @@ -5,7 +5,7 @@ import { join, dirname } from 'path'; * This function is used to resolve the absolute path of a package. * It is needed in projects that use Yarn PnP or are set up within a monorepo. */ -function getAbsolutePath(value: string): any { +function getAbsolutePath(value: string): string { return dirname(require.resolve(join(value, 'package.json'))); } const config: StorybookConfig = { @@ -22,9 +22,17 @@ const config: StorybookConfig = { ], framework: { name: getAbsolutePath('@storybook/react-webpack5'), - options: { - plugins: [], - }, + options: {}, }, + // https://storybook.js.org/docs/configure/integration/compilers#the-swc-compiler-doesnt-work-with-react + swc: () => ({ + jsc: { + transform: { + react: { + runtime: 'automatic', + }, + }, + }, + }), }; export default config;