Closed eightHundreds closed 3 years ago
背景: https://github.com/istanbuljs/babel-plugin-istanbul/issues/161
使用babel-plugin-istanbul 编译下面代码
import { Layout } from 'antd';
const { Content } Layout;
console.log(Content)
结果:
function cov_2fztfe5rtr() {
// ...
}
cov_2fztfe5rtr();
import { Layout } from 'antd';
const _ref = (cov_2fztfe5rtr().s[0]++, Layout), // 逗号表达式
Content = _ref.Content;
cov_2fztfe5rtr().s[1]++;
console.log(Content);
再经过babel-plugin-import编译,最后出现import消失但没有生成对应require
升级包后解决
输入
输出
期望