$ npm install babel-plugin-transform-object-assign
Replace Object.assign
with an inline helper.
In
Object.assign(a, b);
Out
var _extends = ...;
_extends(a, b);
$ npm install babel-plugin-transform-object-assign
.babelrc
(Recommended).babelrc
{
"plugins": ["transform-object-assign"]
}
$ babel --plugins transform-object-assign script.js
require("babel-core").transform("code", {
plugins: ["transform-object-assign"]
});
© 2010 - cnpmjs.org x YWFE | Home | YWFE