babel-plugin-wpm
v0.0.2
Published
Some specific transformers for Web Package Manager
Downloads
4
Readme
babel-plugin-wpm
Some specific transformer(s) for Web Package Manager
Input
Class({
IndexRoute() {
},
signin() {
}
});
Output
Class({
constructor: function IndexRoute() {
},
signin: function signin() {
}
});
Rules
- 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.
Installation
$ npm install babel-plugin-wpm
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["babel-plugin-wpm"]
}
Via CLI
$ babel --plugins babel-plugin-wpm script.js
Via Node API
require("babel-core").transform("code", {
plugins: ["babel-plugin-wpm"]
});