nl_tokens: Add component same name files
pl_tokens: function addComponentSameNameFiles ( scriptFile , options ) { const { dirname : currDir , path : relPath } = scriptFile ; const scriptFileName = getFileName ( relPath ) ; // fullPath let filePathBase = path . join ( currDir , scriptFileName ) ; const { root , addFile , sourceDir , getFileByFullPath , appType , wx2swan , componentExtname , logger } = options ; let compFilesInfo = getCompFilesInfoByAppType ( filePathBase , { appType , wx2swan , componentExtname , compileContext : options } ) ; let { componentType , missingMustFileExtnames , fileExtnameMap } = compFilesInfo ; let jsonFile ; if ( ! isFileInSourceDir ( scriptFile . path , sourceDir ) ) { Object . <mask> ( fileExtnameMap || { } ) . forEach ( k => { let fileObj = addFile ( fileExtnameMap [ k ] ) ; if ( fileObj . isJson ) { jsonFile = fileObj ; } } ) ; } else { jsonFile = getFileByFullPath ( ` ${ filePathBase } ` ) ; if ( jsonFile && ! jsonFile . owner ) { Object . keys ( fileExtnameMap || { } ) . forEach ( k => { addFile ( fileExtnameMap [ k ] ) ; } ) ; } } // all must have js script except quick if ( componentType && scriptFile ) { scriptFile [ componentType ] = true ; } if ( jsonFile ) { jsonFile . isComponentConfig = true ; jsonFile . component = scriptFile ; addFile ( fileExtnameMap . json ) ; } if ( missingMustFileExtnames . length ) { let compFile = getRelative ( filePathBase , root ) ; missingMustFileExtnames . forEach ( ext => { logger . error ( ` co mpFile}. $ ex t}」 . } ) ; } }