babel-plugin-wpm

0.0.2 • Public • Published

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"]
});

Readme

Keywords

Package Sidebar

Install

npm i babel-plugin-wpm

Weekly Downloads

2

Version

0.0.2

License

MIT

Last publish

Collaborators

  • tnhu