You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
4
4
@@ -133,6 +133,26 @@ This will apply the plugin in all phases except `PHASE_DEVELOPMENT_SERVER`.
133
133
134
134
Any direct [next.js configuration](https://github.com/zeit/next.js#custom-configuration) can go here, for example: `{distDir: 'dist'}`.
135
135
136
+
You can also customize the webpack configuration of next.js within this object.
137
+
138
+
```javascript
139
+
constwithPlugins=require('next-compose-plugins');
140
+
141
+
constnextConfig= {
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
+
136
156
### Optional plugins
137
157
138
158
If a plugin should only get loaded when it is used, you can use the `optional` helper function.
0 commit comments