babel-plugin-math-precision
v0.1.4
Published
- 安装 ```js npm i -D babel-plugin-math-precision ```
Downloads
3
Readme
处理JS精度的babel插件
- 安装
npm i -D babel-plugin-math-precision
使用方法
- babel.rc
{ "plugins": ["math-precision"] }
- webpack.config.js
{ test: /\.js|x$/, loader: 'babel-loader', option: { plugins: [ require('babel-plugin-math-precision') ] } }
实例
// 代码中 const a = 1 + 2; // 打包后 var { mathPlus } = require("babel-plugin-math-precision/lib/mathCalc.js"); const a = mathPlus(1, 2);