File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
packages/cli-config-android/src/config Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,20 @@ import {extractComponentDescriptors} from './extractComponentDescriptors';
5
5
import { unixifyPaths } from '@react-native-community/cli-tools' ;
6
6
7
7
export function findComponentDescriptors ( packageRoot : string ) {
8
- const files = glob . sync ( '**/+(*.js|*.jsx|*.ts|*.tsx)' , {
8
+ let jsSrcsDir = null ;
9
+ try {
10
+ const packageJson = fs . readFileSync (
11
+ path . join ( packageRoot , 'package.json' ) ,
12
+ 'utf8' ,
13
+ ) ;
14
+ jsSrcsDir = JSON . parse ( packageJson ) . codegenConfig . jsSrcsDir ;
15
+ } catch ( error ) {
16
+ // no jsSrcsDir, continue with default glob pattern
17
+ }
18
+ const globPattern = jsSrcsDir
19
+ ? `${ jsSrcsDir } /**/+(*.js|*.jsx|*.ts|*.tsx)`
20
+ : '**/+(*.js|*.jsx|*.ts|*.tsx)' ;
21
+ const files = glob . sync ( globPattern , {
9
22
cwd : unixifyPaths ( packageRoot ) ,
10
23
onlyFiles : true ,
11
24
ignore : [ '**/node_modules/**' ] ,
You can’t perform that action at this time.
0 commit comments