$ npm install babel-plugin-minify-numeric-literals
Shortening of numeric literals via scientific notation
In
[1000, -20000]
Out
[1e3, -2e4]
npm install babel-plugin-minify-numeric-literals --save-dev
.babelrc
(Recommended).babelrc
{
"plugins": ["minify-numeric-literals"]
}
babel --plugins minify-numeric-literals script.js
require("@babel/core").transform("code", {
plugins: ["minify-numeric-literals"]
});
© 2010 - cnpmjs.org x YWFE | Home | YWFE