File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,17 @@ const components = fs.readFileSync(path.join(__dirname, '../src/index.js'))
15
15
. split ( '\n' )
16
16
. map ( line => line . split ( ' ' ) . pop ( ) . replace ( / ( ' | ; ) / g, '' ) )
17
17
. 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
+ } ) ;
19
29
20
30
const items = [ ] ;
21
31
const index = [ ] ;
You can’t perform that action at this time.
0 commit comments