Skip to content

Instantly share code, notes, and snippets.

@RafalFilipek
Last active March 1, 2016 08:55
Show Gist options
  • Save RafalFilipek/f96e92a3b1f481ea53d0 to your computer and use it in GitHub Desktop.
Save RafalFilipek/f96e92a3b1f481ea53d0 to your computer and use it in GitHub Desktop.
babel 6.6
// input
export const foo = (bar = 1) => {
console.log(bar)
}
//output
"use strict";
var _arguments = arguments; // ???
exports.__esModule = true;
var foo = exports.foo = function foo() {
var bar = _arguments.length <= 0 || _arguments[0] === undefined ? 1 : _arguments[0];
console.log(bar);
};
@RafalFilipek
Copy link
Author

.babelrc

{
  "presets": ["es2015-loose", "stage-0", "react"],
  "plugins": ["add-module-exports", "transform-runtime"]
}

packages

"babel-cli": "6.6.0",
"babel-plugin-add-module-exports": "0.1.2",
"babel-plugin-transform-runtime": "6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-es2015-loose": "7.0.0",
"babel-preset-react": "6.5.0",
"babel-preset-stage-0": "6.5.0",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment