File tree 2 files changed +8
-4
lines changed
packages/babel-preset-react-app
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,7 @@ const plugins = [
30
30
regenerator : true ,
31
31
// Resolve the Babel runtime relative to the config.
32
32
moduleName : path . dirname ( require . resolve ( 'babel-runtime/package' ) )
33
- } ] ,
34
- // Enables parsing of import()
35
- require . resolve ( 'babel-plugin-syntax-dynamic-import' )
33
+ } ]
36
34
] ;
37
35
38
36
// This is similar to how `env` works in Babel:
@@ -77,7 +75,10 @@ if (env === 'test') {
77
75
// JSX, Flow
78
76
require . resolve ( 'babel-preset-react' )
79
77
] ,
80
- plugins : plugins
78
+ plugins : plugins . concat ( [
79
+ // Compiles import() to a deferred require()
80
+ require . resolve ( 'babel-plugin-dynamic-import-node' )
81
+ ] )
81
82
} ;
82
83
} else {
83
84
module . exports = {
@@ -97,6 +98,8 @@ if (env === 'test') {
97
98
// Async functions are converted to generators by babel-preset-latest
98
99
async : false
99
100
} ] ,
101
+ // Adds syntax support for import()
102
+ require . resolve ( 'babel-plugin-syntax-dynamic-import' ) ,
100
103
] )
101
104
} ;
102
105
Original file line number Diff line number Diff line change 11
11
" index.js"
12
12
],
13
13
"dependencies" : {
14
+ "babel-plugin-dynamic-import-node" : " 1.0.0" ,
14
15
"babel-plugin-syntax-dynamic-import" : " 6.18.0" ,
15
16
"babel-plugin-transform-class-properties" : " 6.22.0" ,
16
17
"babel-plugin-transform-object-rest-spread" : " 6.22.0" ,
You can’t perform that action at this time.
0 commit comments