hy-babel-plugins
v1.0.8
Published
```bash stylePxToVw # j|tsx style属性附加 px to vw的转换
Downloads
27
Readme
webpack babel 编译插件
插件说明
stylePxToVw # j|tsx style属性附加 px to vw的转换
APIToTS # 接口json自动生成ts类型声明并注入到接口源码
numericalPrecision #数字运算精度转换, 加减乘除自动转换为数字精度计算的模式 引入的工具库必须要有 plus, minus,times,div 方法
引入方式
//webpack.config.js
const { stylePxToVw, APIToTS, numericalPrecision} = require('hy-babel-plugins')
{
loader: 'babel-loader',
options: {
targets: {
esmodules: true
},
plugins: [
stylePxToVw(),
APIToTS({ includes: ['api.ts'] }),
numericalPrecision({ defaultPrecision:4, tool:'Decimal',importPath:'Decimal' })
],
}
}