@@ -24,8 +24,8 @@ let moduleNames = [];
24
24
25
25
function installedLocalModulePaths ( ) {
26
26
return execa ( 'npm' , [ 'ls' , '--parseable' ] , { cwd : optionsGlobal . root } )
27
- . then ( res => res . stdout . split ( '\n' ) . filter ( ( line , i ) => i !== 0 ) )
28
- . catch ( res => res . stdout . split ( '\n' ) . filter ( ( line , i ) => i !== 0 ) ) ;
27
+ . then ( res => res . stdout . split ( '\n' ) . filter ( ( line , i ) => i !== 0 && ! ! line ) )
28
+ . catch ( res => res . stdout . split ( '\n' ) . filter ( ( line , i ) => i !== 0 && ! ! line ) ) ;
29
29
}
30
30
31
31
function getFilesRecursively ( targetDir , extension ) {
@@ -49,7 +49,8 @@ export async function processAll(options) {
49
49
debugDetail ( `starting resolution: ${ options . root } ` ) ;
50
50
51
51
if ( modulePaths . length === 0 ) {
52
- modulePaths = ( await installedLocalModulePaths ( ) ) . map ( line => path . normalize ( line ) ) ;
52
+ modulePaths = ( await installedLocalModulePaths ( ) )
53
+ . map ( line => path . normalize ( line ) ) ;
53
54
moduleNames = modulePaths
54
55
. map ( line => {
55
56
const split = line . split ( '/node_modules/' ) ;
@@ -328,7 +329,7 @@ function fixRelativeFromPath(fromPath, realSrcPath, realParentPath, externalModu
328
329
} else {
329
330
// if starts with './' then relative to the template, else relative to '/src'
330
331
if ( fromPath . indexOf ( '.' ) == 0 ) {
331
- debugDetail ( `fixing relative path: ${ fromPath } | relative dir: ${ path . relative ( realSrcPath , realParentPath ) } ` )
332
+ // debugDetail(`fixing relative path: ${fromPath} | relative dir: ${path.relative(realSrcPath, realParentPath)}`)
332
333
fromPath = path . joinSafe ( './' , path . relative ( realSrcPath , realParentPath ) , fromPath ) ;
333
334
}
334
335
return externalModule ? path . join ( externalModule , fromPath ) : fromPath ;
0 commit comments