1
1
import compileModule from '../../../utils/compileModule' ;
2
2
import pkg from 'babel7/package.json' ;
3
-
4
3
const ID = 'babelv7' ;
5
4
6
5
export default {
@@ -16,44 +15,19 @@ export default {
16
15
'../../../transpilers/babel' ,
17
16
'babel7' ,
18
17
'recast' ,
19
- ] , ( transpile , babel , recast ) => callback ( { transpile : transpile . default , babel, recast } ) ) ;
18
+ '../../babylon7.js' ,
19
+ ] , ( transpile , babel , recast , babylon7 ) => callback ( { transpile : transpile . default , babel, recast, babylon7 } ) ) ;
20
20
} ,
21
21
22
- transform ( { transpile, babel, recast } , transformCode , code ) {
22
+ transform ( { transpile, babel, recast, babylon7 } , transformCode , code ) {
23
23
transformCode = transpile ( transformCode ) ;
24
24
let transform = compileModule ( // eslint-disable-line no-shadow
25
25
transformCode ,
26
26
) ;
27
-
28
27
return babel . transformAsync ( code , {
29
28
parserOpts : {
30
29
parser : recast . parse ,
31
- plugins : [
32
- 'asyncGenerators' ,
33
- 'bigInt' ,
34
- 'classPrivateMethods' ,
35
- 'classPrivateProperties' ,
36
- 'classProperties' ,
37
- [ 'decorators' , { decoratorsBeforeExport : false } ] ,
38
- 'doExpressions' ,
39
- 'dynamicImport' ,
40
- 'exportDefaultFrom' ,
41
- 'exportNamespaceFrom' ,
42
- 'flow' ,
43
- 'flowComments' ,
44
- 'functionBind' ,
45
- 'functionSent' ,
46
- 'importMeta' ,
47
- 'jsx' ,
48
- 'logicalAssignment' ,
49
- 'nullishCoalescingOperator' ,
50
- 'numericSeparator' ,
51
- 'objectRestSpread' ,
52
- 'optionalCatchBinding' ,
53
- 'optionalChaining' ,
54
- [ 'pipelineOperator' , { proposal : 'minimal' } ] ,
55
- 'throwExpressions' ,
56
- ] ,
30
+ plugins : babylon7 . parserOptions ,
57
31
} ,
58
32
retainLines : false ,
59
33
generatorOpts : {
0 commit comments