fix canon storybook config

Signed-off-by: Paul Schultz <pschultz@pobox.com>
This commit is contained in:
Paul Schultz
2025-01-28 13:20:35 -06:00
parent 33111f8bcd
commit b01b0d03dd
+12 -4
View File
@@ -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;