mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-01 09:01:04 +08:00
Add dynamic import transformer for dependencies in test env (#5110)
This commit is contained in:
@@ -107,6 +107,9 @@ module.exports = function(api, opts) {
|
||||
],
|
||||
// Adds syntax support for import()
|
||||
require('@babel/plugin-syntax-dynamic-import').default,
|
||||
isEnvTest &&
|
||||
// Transform dynamic import to require
|
||||
require('babel-plugin-transform-dynamic-import').default,
|
||||
].filter(Boolean),
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user