File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const smartGlob = require('../smart_glob.js');
8
8
9
9
const STANDARD_BABEL_CONFIG = {
10
10
compact : false ,
11
- parserOpts : { plugins : [ ...standardBabelParserPlugins , 'flow' ] }
11
+ parserOpts : { plugins : [ ...standardBabelParserPlugins , 'flow' , 'jsx' ] }
12
12
} ;
13
13
14
14
/**
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ const babelParser = require('@babel/parser');
2
2
const path = require ( 'path' ) ;
3
3
4
4
const TYPESCRIPT_EXTS = {
5
- '.ts' : true ,
6
- '.tsx' : true
5
+ '.ts' : [ 'typescript' ] ,
6
+ '.tsx' : [ 'typescript' , 'jsx' ]
7
7
} ;
8
8
9
9
const standardBabelParserPlugins = [
@@ -14,7 +14,6 @@ const standardBabelParserPlugins = [
14
14
'exportDefaultFrom' ,
15
15
'exportExtensions' ,
16
16
'functionBind' ,
17
- 'jsx' ,
18
17
'partialApplication' ,
19
18
[ 'pipelineOperator' , { proposal : 'minimal' } ] ,
20
19
'throwExpressions'
@@ -29,7 +28,7 @@ function getParserOpts(file) {
29
28
plugins : [
30
29
...standardBabelParserPlugins ,
31
30
[ 'decorators' , { decoratorsBeforeExport : false } ] ,
32
- TYPESCRIPT_EXTS [ path . extname ( file || '' ) ] ? 'typescript' : 'flow'
31
+ ... ( TYPESCRIPT_EXTS [ path . extname ( file || '' ) ] || [ 'flow' , 'jsx' ] )
33
32
]
34
33
} ;
35
34
}
You can’t perform that action at this time.
0 commit comments