File tree Expand file tree Collapse file tree
packages/graphpack/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -236,7 +236,20 @@ For custom configuration you can create a `graphpack` config file in [cosmiconfi
236236
237237### Customize Webpack configuration
238238
239- To extend webpack, you can define a function that extends its config via ` graphpack.config.js ` .
239+ To extend webpack, you can define a function that extends its config via the config file:
240+
241+ ``` js
242+ // graphpack.config.js
243+ module .exports = {
244+ webpack : ({ config, webpack }) => {
245+ // Add customizations to config
246+ // Important: return the modified config
247+ return config;
248+ },
249+ };
250+ ```
251+
252+ > Note that this file is not going through babel transformation.
240253
241254## Acknowledgements
242255
Original file line number Diff line number Diff line change 11const cosmiconfig = require ( 'cosmiconfig' ) ;
2+ const webpack = require ( 'webpack' ) ;
23const defaultConfig = require ( './webpack.config' ) ;
34
45const explorer = cosmiconfig ( 'graphpack' ) . search ( ) ;
@@ -12,7 +13,7 @@ const loadWebpackConfig = async () => {
1213 : { } ;
1314
1415 if ( typeof userConfig . webpack === 'function' ) {
15- return userConfig . webpack ( defaultConfig ) ;
16+ return userConfig . webpack ( { config : defaultConfig , webpack } ) ;
1617 }
1718
1819 return defaultConfig ;
You can’t perform that action at this time.
0 commit comments