Skip to content

Commit bc4ccc6

Browse files
committed
Update readme
1 parent 9074505 commit bc4ccc6

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 💡 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)
1+
# :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)
22

33
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.
44

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

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

136+
You can also customize the webpack configuration of next.js within this object.
137+
138+
```javascript
139+
const withPlugins = require('next-compose-plugins');
140+
141+
const nextConfig = {
142+
distDir: 'build',
143+
webpack: (config, options) => {
144+
145+
// modify the `config` here
146+
147+
return config;
148+
},
149+
};
150+
151+
module.exports = withPlugins([
152+
// add plugins here..
153+
], nextConfig);
154+
```
155+
136156
### Optional plugins
137157

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

0 commit comments

Comments
 (0)