1.0.8 • Published 1 year ago

hy-babel-plugins v1.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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' })
              ],
            }
}
1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.0

1 year ago