# react-app-rewire-antd

> Load antd into your create-react-app app via react-app-rewired.

Latest version **1.0.3** (published 2018-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-app-rewire-antd
pnpm add react-app-rewire-antd
yarn add react-app-rewire-antd
bun add react-app-rewire-antd
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-01-18 |
| First published | 2018-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | m31271n |
| Maintainers | m31271n |

## Links

- npm: https://www.npmjs.com/package/react-app-rewire-antd
- Repository: https://github.com/m31271n/react-app-rewire-antd
- Homepage: https://github.com/m31271n/react-app-rewire-antd#readme
- Issues: https://github.com/m31271n/react-app-rewire-antd/issues
- npm.io page: https://npm.io/package/react-app-rewire-antd

## Dependencies (4)

- [is](https://npm.io/package/is.md) ^3.2.1
- [react-app-rewired](https://npm.io/package/react-app-rewired.md) ^1.4.0
- [babel-plugin-import](https://npm.io/package/babel-plugin-import.md) ^1.6.3
- [react-app-rewire-less](https://npm.io/package/react-app-rewire-less.md) ^2.1.0

## Recent versions

- 1.0.3 (latest) — 2018-01-18
- 1.0.2 — 2018-01-18
- 1.0.1 — 2018-01-18
- 1.0.0 — 2018-01-18
- 0.2.0 — 2018-01-18
- 0.0.0 — 2018-01-18

## README

# react-app-rewire-antd

[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://standardjs.com/)
[![Dependency Status](https://img.shields.io/david/m31271n/react-app-rewire-antd.svg)](#)
[![DevDependency Status](https://img.shields.io/david/m31271n/react-app-rewire-antd.svg)](#)
[![NPM Downloads](https://img.shields.io/npm/dm/react-app-rewire-antd.svg)](#)
[![Travis Build Status](https://img.shields.io/travis/m31271n/react-app-rewire-antd.svg)](#)

> Load antd into your create-react-app app via react-app-rewired.

## Install

```
$ npm install react-app-rewire-antd
```

## Usage

First, edit `config-overrides.js`:

```js
/* config-overrides.js */
const rewireAntd = require('react-app-rewire-antd')

module.exports = function override(config, env) {

  // ...

  config = rewireAntd({
    '@primary-color': 'rgb(97,43,189)'
  })(config, env)

  // ...

  return config
}
```

Then, use `antd` as normal module. antd's components related JS and CSS will be imported on demand:

```js
import React, { Component } from 'react';
import { Button } from 'antd'; // only import Button related JS and CSS

class App extends Component {
  render() {
    return (
      <div>
        <Button type="primary">Button</Button>
      </div>
    );
  }
}

export default App;
```

That's it !

## API
### rewireAntd(options)
+ `options`
  + type: Object
  + default value: `{}`
  + description: key-value pairs in `options` will be used to replace [antd's default variables](https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less).

## How it works
Thanks to the power of following packages:
+ `react-app-rewired`
+ `react-app-rewire-less`
+ `babel-plugin-import`

And following packages:
+ [create-react-app-antd](https://github.com/ant-design/create-react-app-antd)

And official ant-design docs:
+ [Customize Theme](https://ant.design/docs/react/customize-theme)
+ [Use antd with create-react-app - Advanced-Guides](https://ant.design/docs/react/use-with-create-react-app#Advanced-Guides)

* * *

<p align="center">Made with ❤ by <a href="http://stack.m31271n.com">m31271n</a></p>

---
_Source: https://npm.io/package/react-app-rewire-antd · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
