Skip to content

Commit

Permalink
docs(compose-plugin): add readme file for compose-plugin [skip ci] (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvinkl committed Mar 27, 2019
1 parent 208eaa0 commit f2a1456
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -4,6 +4,7 @@
- [@airy/maleo-css-plugin](https://github.com/airyrooms/maleo-plugins/tree/master/packages/css-plugin)
- [@airy/maleo-redux-plugin](https://github.com/airyrooms/maleo-plugins/tree/master/packages/redux-plugin)
- [@airy/maleo-typescript-plugin](https://github.com/airyrooms/maleo-plugins/tree/master/packages/typescript-plugin)
- [@airy/maleo-compose-plugin](https://github.com/airyrooms/maleo-plugins/tree/master/packages/compose-plugin)
- [more to come](https://github.com/airyrooms/maleo.js/issues/152)


Expand Down
41 changes: 41 additions & 0 deletions packages/compose-plugin/README.md
@@ -0,0 +1,41 @@
# Maleo Compose Plugin

Compose Plugin is to make your maleo plugins config easier to read.

## Installation
**NPM**
```bash
$ npm install --save @airy/maleo-compose-plugin
```
**Yarn**
```bash
$ yarn add @airy/maleo-compose-plugin
```

## How To Use

### Basic Usage
Add the plugins you use to your `maleo.config.js`

Wrap the plugins under compose plugin function.
For example:
```javascript
// maleo.config.js
const cssPlugin = require('@airy/maleo-css-plugin');
const typescriptPlugin = require('@airy/maleo-typescript-plugin');
// add this
const compose = require('@airy/maleo-compose-plugin');

module.exports = compose([
[typescriptPlugin, { /* typescript plugin option */ }],
[cssPlugin, { /* css plugin option */ }],
],
{
/* your config for maleo */
webpack(config, context, next) {
// your custom webpack config
return next()
}
}
);
```

0 comments on commit f2a1456

Please sign in to comment.