Some specific transformer(s) for Web Package Manager
Class({
IndexRoute() {
},
signin() {
}
});
Class({
constructor: function IndexRoute() {
},
signin: function signin() {
}
});
- If there is only one CamelCase method. The method becomes constructor.
- If there are more than one CamelCase methods, the first CamelCase method becomes constructor.
$ npm install babel-plugin-wpm
.babelrc
{
"plugins": ["babel-plugin-wpm"]
}
$ babel --plugins babel-plugin-wpm script.js
require("babel-core").transform("code", {
plugins: ["babel-plugin-wpm"]
});