Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(compose-plugin): add readme file for compose-plugin [skip ci] (#4)
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
} | ||
} | ||
); | ||
``` |