fix canon storybook config
Signed-off-by: Paul Schultz <pschultz@pobox.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user