Conflict between babel-plugin-transform-es2015-modules-amd and antd

because other libraries in the project need the babel-plugin-transform-es2015-modules-amd plug-in for babel, but after configuration, antd will have a problem.

clipboard.png

clipboard.png

clipboard.png

clipboard.png

how to configure that you can use babel-plugin-transform-es2015-modules-amd and reference antd? at the same time Did you guys meet?

Mar.22,2021

has been solved. Using the third-party library in AMD mode, you can change it to
{
"presets": [["@ babel/preset-env", {"modules": "amd"}], ["@ babel/preset-react"],
"plugins": [

in the bablerc file without using the parameter @ babel/preset-env.
["@babel/plugin-proposal-class-properties"], ["import", { "libraryName": "antd", "libraryDirectory": "es", "style": "css" }]]

}

Menu