File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ const babelRegisterOnly = require('metro-bundler/src/babelRegisterOnly');
25
25
* found when Flow v0.54 was deployed. To see the error delete this comment and
26
26
* run Flow. */
27
27
const createCacheKeyFunction = require ( 'fbjs-scripts/jest/createCacheKeyFunction' ) ;
28
+ const generate = require ( 'babel-generator' ) . default ;
28
29
29
30
const nodeFiles = RegExp ( [
30
31
'/local-cli/' ,
@@ -47,7 +48,7 @@ module.exports = {
47
48
) . code ;
48
49
}
49
50
50
- return transformer . transform ( {
51
+ const { ast } = transformer . transform ( {
51
52
filename : file ,
52
53
localPath : file ,
53
54
options : {
@@ -58,7 +59,17 @@ module.exports = {
58
59
retainLines : true ,
59
60
} ,
60
61
src,
61
- } ) . code ;
62
+ } ) ;
63
+
64
+ return generate ( ast , {
65
+ code : true ,
66
+ comments : false ,
67
+ compact : false ,
68
+ filename : file ,
69
+ retainLines : true ,
70
+ sourceFileName : file ,
71
+ sourceMaps : true ,
72
+ } , src ) . code ;
62
73
} ,
63
74
64
75
getCacheKey : createCacheKeyFunction ( [
You can’t perform that action at this time.
0 commit comments