File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1+ import  {  createRequire  }  from  'node:module' 
12import  path  from  'node:path' 
23
34import  type  {  PresetProperty  }  from  '@storybook/types' 
@@ -12,8 +13,14 @@ import { mockRouter } from './plugins/mock-router.js'
1213import  {  reactDocgen  }  from  './plugins/react-docgen.js' 
1314import  type  {  StorybookConfig  }  from  './types.js' 
1415
15- const  getAbsolutePath  =  ( input : string )  => 
16-   path . dirname ( require . resolve ( path . join ( input ,  'package.json' ) ) ) 
16+ function  getAbsolutePath ( input : string )  { 
17+   const  createdRequire  =  createRequire ( import . meta. url ) 
18+   return  path . dirname ( 
19+     createdRequire . resolve ( path . join ( input ,  'package.json' ) ,  { 
20+       paths : [ getPaths ( ) . base ] , 
21+     } ) , 
22+   ) 
23+ } 
1724
1825export  const  core : PresetProperty < 'core' >  =  { 
1926  builder : getAbsolutePath ( '@storybook/builder-vite' ) , 
@@ -23,7 +30,8 @@ export const core: PresetProperty<'core'> = {
2330export  const  previewAnnotations : StorybookConfig [ 'previewAnnotations' ]  =  ( 
2431  entry , 
2532)  =>  { 
26-   return  [ ...entry ,  require . resolve ( './preview.js' ) ] 
33+   const  createdRequire  =  createRequire ( import . meta. url ) 
34+   return  [ ...entry ,  createdRequire . resolve ( './preview.js' ) ] 
2735} 
2836
2937const  redwoodProjectPaths  =  getPaths ( ) 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments