Skip to content

Commit 409e571

Browse files
lixiaoyanTimer
authored andcommitted
Add dynamic import transformer for dependencies in test env (facebook#5110)
1 parent 46b18d9 commit 409e571

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/babel-preset-react-app/dependencies.js

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ module.exports = function(api, opts) {
107107
],
108108
// Adds syntax support for import()
109109
require('@babel/plugin-syntax-dynamic-import').default,
110+
isEnvTest &&
111+
// Transform dynamic import to require
112+
require('babel-plugin-transform-dynamic-import').default,
110113
].filter(Boolean),
111114
};
112115
};

0 commit comments

Comments
 (0)