We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import { DatePicker } from 'antd'; const { RangePicker } = DatePicker;
{ "presets": [ "@babel/preset-react", [ "@babel/preset-env" ], "@babel/preset-typescript" ], "ignore": [ "./src/common/UEditor/ueditor.all.js" ], "plugins": [ "react-hot-loader/babel", [ "react-css-modules", { "filetypes": { ".less": { "syntax": "postcss-less" } }, "webpackHotModuleReloading": true, "generateScopedName": "[name]__[local]__[hash:base64:5]" } ], ["@babel/plugin-transform-runtime", { "corejs": false, // 下面详解 "helpers": false, // 助手函数是否提取,同babel-plugin-transform "regenerator": true, // 同babel-plugin-transform "useESModules": false }], [ "import", { "libraryName": "antd", "libraryDirectory": "es", "style": "css" } ], [ "module-resolver", { "root": [ "./src" ], "alias": { "@common": "./src/common", "@main": "./src/app/main" } } ], "@babel/plugin-syntax-dynamic-import", "@babel/plugin-syntax-import-meta", "@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-json-strings", [ "@babel/plugin-proposal-decorators", { "legacy": true } ], "@babel/plugin-proposal-function-sent", "@babel/plugin-proposal-export-namespace-from", "@babel/plugin-proposal-numeric-separator", "@babel/plugin-proposal-throw-expressions", "@babel/plugin-proposal-export-default-from", "@babel/plugin-proposal-logical-assignment-operators", "@babel/plugin-proposal-optional-chaining", [ "@babel/plugin-proposal-pipeline-operator", { "proposal": "minimal" } ], "@babel/plugin-proposal-nullish-coalescing-operator", "@babel/plugin-proposal-do-expressions", "@babel/plugin-proposal-function-bind", "@babel/plugin-transform-destructuring", "@babel/plugin-transform-modules-commonjs" ], "env": { "dev": { "plugins": [ "istanbul" ] } } }
The text was updated successfully, but these errors were encountered:
istanbuljs/babel-plugin-istanbul#161
同样的问题 +1
当使用 babel-plugin-istanbul + 导出内容解构 的时候 import of DatePicker 被丢掉了
babel-plugin-istanbul
import of DatePicker
本应该得到
// 不开启 istanbul 插件 import "antd/es/date-picker/style/css"; import _DatePicker from "antd/es/date-picker"; const { RangePicker } = _DatePicker;
实际实际编译后只剩下了,由于没有 DatePicker 引入 RangePicker 结构失败
DatePicker
const { RangePicker } = (cov_1rg8pvnktm().s[0]++, DatePicker);
最小可复现内容 .babelrc
{ "presets": [], "plugins": [ [ "import", { "libraryName": "antd", "libraryDirectory": "es", "style": "css" } ], "babel-plugin-istanbul" ] }
index.js
import { DatePicker } from 'antd'; const { RangePicker } = DatePicker; // const RangePicker = DatePicker.RangePicker // 不使用解构语法的时候也没问题 console.log(RangePicker);
Sorry, something went wrong.
请问这问题解决了吗现在?
No branches or pull requests
错误信息
对应代码
.babelrc
The text was updated successfully, but these errors were encountered: