Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrilwanner committed May 10, 2018
1 parent 9074505 commit bc4ccc6
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 💡 next-compose-plugins [![npm version](https://img.shields.io/npm/v/next-compose-plugins.svg)](https://www.npmjs.com/package/next-compose-plugins) [![license](https://img.shields.io/github/license/cyrilwanner/next-compose-plugins.svg)](https://github.com/cyrilwanner/next-compose-plugins/blob/master/LICENSE)
# :bulb: next-compose-plugins [![npm version](https://img.shields.io/npm/v/next-compose-plugins.svg)](https://www.npmjs.com/package/next-compose-plugins) [![license](https://img.shields.io/github/license/cyrilwanner/next-compose-plugins.svg)](https://github.com/cyrilwanner/next-compose-plugins/blob/master/LICENSE)

Provides a cleaner API for enabling and configuring plugins for [next.js](https://github.com/zeit/next.js) because the default way next.js suggests to enable and configure plugins can get unclear and confusing when you have many plugins.

Expand Down Expand Up @@ -133,6 +133,26 @@ This will apply the plugin in all phases except `PHASE_DEVELOPMENT_SERVER`.

Any direct [next.js configuration](https://github.com/zeit/next.js#custom-configuration) can go here, for example: `{distDir: 'dist'}`.

You can also customize the webpack configuration of next.js within this object.

```javascript
const withPlugins = require('next-compose-plugins');

const nextConfig = {
distDir: 'build',
webpack: (config, options) => {

// modify the `config` here

return config;
},
};

module.exports = withPlugins([
// add plugins here..
], nextConfig);
```

### Optional plugins

If a plugin should only get loaded when it is used, you can use the `optional` helper function.
Expand Down

0 comments on commit bc4ccc6

Please sign in to comment.