File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,17 @@ const components = fs.readFileSync(path.join(__dirname, '../src/index.js'))
1515 . split ( '\n' )
1616 . map ( line => line . split ( ' ' ) . pop ( ) . replace ( / ( ' | ; ) / g, '' ) )
1717 . filter ( line => line . startsWith ( './components/' ) )
18- . map ( line => require . resolve ( path . join ( __dirname , '../src' , line ) ) ) ;
18+ . map ( line => {
19+ const file = require . resolve ( path . join ( __dirname , '../src' , line ) ) ;
20+ if ( file . endsWith ( '/index.js' ) ) {
21+ const matches = fs . readFileSync ( file ) . toString ( ) . match ( / e x p o r t \{ d e f a u l t a s d e f a u l t \} f r o m .+ / ) ;
22+ if ( matches && matches . length ) {
23+ const name = matches [ 0 ] . split ( ' ' ) . pop ( ) . replace ( / ( ' | ; ) / g, '' ) ;
24+ return require . resolve ( path . join ( __dirname , '../src' , line , name ) ) ;
25+ }
26+ }
27+ return file ;
28+ } ) ;
1929
2030const items = [ ] ;
2131const index = [ ] ;
You can’t perform that action at this time.
0 commit comments