1- const cssLoaderConfig = require ( './css-loader-config' )
1+ const cssLoaderConfig = require ( './css-loader-config' ) ;
22
33module . exports = ( nextConfig = { } ) => {
44 return Object . assign ( { } , nextConfig , {
55 webpack ( config , options ) {
66 if ( ! options . defaultLoaders ) {
77 throw new Error (
8- 'This plugin is not compatible with Next.js versions below 5.0.0 https://err.sh/next-plugins/upgrade' ,
9- )
8+ 'This plugin is not compatible with Next.js versions below 5.0.0 https://err.sh/next-plugins/upgrade'
9+ ) ;
1010 }
1111
12- const { dev, isServer } = options
13- const { cssLoaderOptions, postcssLoaderOptions } = nextConfig
12+ const { dev, isServer } = options ;
13+ const { cssLoaderOptions, postcssLoaderOptions } = nextConfig ;
1414
1515 const createStyleConfig = cssModules =>
1616 ( options . defaultLoaders . css = cssLoaderConfig ( config , {
@@ -19,35 +19,35 @@ module.exports = (nextConfig = {}) => {
1919 cssLoaderOptions,
2020 postcssLoaderOptions,
2121 dev,
22- isServer,
23- } ) )
22+ isServer
23+ } ) ) ;
2424
2525 config . module . rules . push ( {
2626 test : / \. c s s $ / ,
2727 oneOf : [
2828 {
2929 resourceQuery : / C S S M o d u l e s D i s a b l e / ,
30- use : createStyleConfig ( false ) ,
30+ use : createStyleConfig ( false )
3131 } ,
3232 {
33- use : createStyleConfig ( true ) ,
34- } ,
33+ use : createStyleConfig ( true )
34+ }
3535 ] ,
3636 issuer ( issuer ) {
3737 if ( issuer . match ( / p a g e s [ \\ / ] _ d o c u m e n t \. j s $ / ) ) {
3838 throw new Error (
39- 'You can not import CSS files in pages/_document.js, use pages/_app.js instead.' ,
40- )
39+ 'You can not import CSS files in pages/_document.js, use pages/_app.js instead.'
40+ ) ;
4141 }
42- return true
43- } ,
44- } )
42+ return true ;
43+ }
44+ } ) ;
4545
4646 if ( typeof nextConfig . webpack === 'function' ) {
47- return nextConfig . webpack ( config , options )
47+ return nextConfig . webpack ( config , options ) ;
4848 }
4949
50- return config
51- } ,
52- } )
53- }
50+ return config ;
51+ }
52+ } ) ;
53+ } ;
0 commit comments