File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/redux-devtools-ui/.storybook Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 11import type { StorybookConfig } from '@storybook/react-webpack5' ;
22
3- import { join , dirname } from 'path' ;
3+ import { dirname } from 'node:path' ;
4+ import { fileURLToPath } from 'node:url' ;
45
56/**
67 * This function is used to resolve the absolute path of a package.
78 * It is needed in projects that use Yarn PnP or are set up within a monorepo.
89 */
9- function getAbsolutePath ( value : string ) : any {
10- return dirname ( require . resolve ( join ( value , 'package.json' ) ) ) ;
10+ function getAbsolutePath ( packageName : string ) {
11+ return dirname (
12+ fileURLToPath ( import . meta. resolve ( `${ packageName } /package.json` ) ) ,
13+ ) ;
1114}
15+
1216const config : StorybookConfig = {
1317 stories : [ '../src/**/*.mdx' , '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)' ] ,
1418 addons : [ getAbsolutePath ( '@storybook/addon-onboarding' ) ] ,
You can’t perform that action at this time.
0 commit comments