[Bug]: babel-jest can not transform antd/es #14656
Labels
i: third party
The report is a problem of third party
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
💻
How are you using Babel?
Programmatic API (
babel.transform
,babel.parse
)Input code
my jest config
my package.json
When i test antd components, The test suite was failed
Configuration file name
babel.config.js
Configuration
Current and expected behavior
When i use antd by config
'libraryDirectory': 'es'
. My jest reported an error.But when i use this config
'libraryDirectory': 'lib'
. My jest will work.I don't think
babel-jest
treats the esmodule of antd as commonjs.Environment
System:
OS: macOS 11.6.4
Binaries:
Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
npmPackages:
@babel/cli: ^7.2.3 => 7.14.8
@babel/core: ^7.3.4 => 7.15.0
@babel/plugin-proposal-class-properties: ^7.0.0 => 7.14.5
@babel/plugin-proposal-decorators: ^7.0.0 => 7.14.5
@babel/plugin-proposal-object-rest-spread: ^7.0.0 => 7.14.7
@babel/plugin-proposal-optional-chaining: ^7.9.0 => 7.14.5
@babel/plugin-proposal-private-methods: ^7.16.0 => 7.16.0
@babel/plugin-proposal-private-property-in-object: ^7.16.0 => 7.16.0
@babel/plugin-transform-runtime: ^7.0.0 => 7.15.0
@babel/polyfill: ^7.2.5 => 7.12.1
@babel/preset-env: ^7.0.0 => 7.15.0
@babel/preset-react: ^7.0.0 => 7.14.5
@babel/preset-typescript: ^7.8.3 => 7.15.0
@babel/runtime: ^7.0.0 => 7.15.3
babel-jest: 28.1.1 => 28.1.1
babel-loader: ^8.2.3 => 8.2.3
babel-plugin-import: ^1.11.0 => 1.13.3
babel-plugin-lodash: ^3.3.4 => 3.3.4
babel-plugin-react-require: ^3.0.0 => 3.1.3
babel-plugin-react-transform: ^3.0.0 => 3.0.0
eslint: ^7.11.0 => 7.32.0
jest: ^24.1.0 => 24.9.0
webpack: ^5.65.0 => 5.65.0
Possible solution
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: