Open Losstie opened 2 years ago
Input is not defined
import {Input, InputNumber } from 'antd'; const FinalInput = ComponentType === 'number' ? InputNumber: Input;
var FinalInput = (cov_16x0fs0ihf.s[13]++, (cov_16x0fs0ihf.b[5][0]++, componentType === \'number\') ||(cov_16x0fs0ihf.b[5][1]++, componentType === \'year\') ? (cov_16x0fs0ihf.b[4][0]++, _antd.InputNumber) : (cov_16x0fs0ihf.b[4][1]++,_antd.Input))
const path = require('path'); module.exports = { presets: [ '@babel/preset-react', [ '@babel/preset-env', { "modules": "commonjs", "targets": { "browsers": ["last 4 versions", "ie >= 9", "safari >= 10"] // "last 2 Chrome versions", }, "useBuiltIns": "entry", "corejs": 2, exclude: ['proposal-dynamic-import'], } ], '@babel/preset-typescript', ], plugins: [ ['babel-plugin-istanbul'], ['@babel/plugin-syntax-dynamic-import'], ['@babel/plugin-transform-async-to-generator'], ['@babel/plugin-proposal-object-rest-spread'], ['@babel/plugin-transform-runtime'], ['@babel/plugin-proposal-decorators', { legacy: true }], ['@babel/plugin-proposal-class-properties', { loose: true }], ['@babel/plugin-proposal-private-methods', { loose: true }], ['@babel/plugin-proposal-private-property-in-object', { loose: true }], [['import', { libraryName: 'antd', libraryDirectory: 'lib', style: false }, 'antd']], ], };
babel-plugin-import目前貌似只针对Property及VariableDeclarator两种节点做了istanbul插桩的兼容,对于上述也算常用的三元表达式没有做兼容。能否兼容处理一下?
有解决方案吗,我也遇到了
错误信息
Input is not defined
对应代码:
istanbul插桩结果
babelConfig.js
原因
babel-plugin-import目前貌似只针对Property及VariableDeclarator两种节点做了istanbul插桩的兼容,对于上述也算常用的三元表达式没有做兼容。能否兼容处理一下?