Socket
Book a DemoInstallSign in
Socket

babel-plugin-override-antd-prefix-cls

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-override-antd-prefix-cls

babel-plugin-override-antd-prefix-cls

0.0.1
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Read babel plugin handbook -> https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md

Try http://astexplorer.net/#/Pcw9baefXI for a visual understanding.

babel-plugin-boilerplate

Add a description for the plugin here

Example

In

import { Button } from 'antd';
import React from 'react';

class App extends React.Component {
  render() {
    <Button> hello world </Button>
  }
}

Out

import 'antd/lib/button/style';
import _Button from 'antd/lib/button';
_Button.defaultProps = Object.assign(_Button.defaultProps || {}, {
  prefixCls: (_Button.defaultProps.prefixCls || '').replace(/ant/g, 'deer')
});

import React from 'react';

class App extends React.Component {
  render() {
    React.createElement(
      _Button,
      null,
      ' hello world '
    );
  }
}

Installation

$ npm install babel-plugin-override-antd-prefix-cls

Usage

.babelrc

{
  "plugins": ["babel-plugin-override-antd-prefix-cls"]
}

Via CLI

$ babel --plugins babel-plugin-override-antd-prefix-cls script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["babel-plugin-override-antd-prefix-cls"]
});

Keywords

babel

FAQs

Package last updated on 09 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.