babel-plugin-react-rename

Rename react components.


Keywords
babel-plugin, babel, bootstart, react
License
CC0-1.0
Install
npm install babel-plugin-react-rename@0.1.0

Documentation

babel-plugin-react-rename

import path from 'path';

export default (componentName, {filename, cwd}) => {
  return path.relative(cwd, path.dirname(filename));
}
{
  "plugins": [
    ["babel-plugin-react-rename", {
      "only": "./src/component/**/*.js",
      "rename": "./config/babel/getComponentName.babel.js"
    }]
  ]
}