(config: webpack.Configuration, options: any)
| 34 | ...nextConfig.onDemandEntries, // use existing onDemandEntries config if provided by user |
| 35 | }, |
| 36 | webpack(config: webpack.Configuration, options: any) { |
| 37 | config.watchOptions = { |
| 38 | ...config.watchOptions, |
| 39 | // ignored: /node_modules([\\]+|\/)+(?!\.contentlayer)/, |
| 40 | ignored: ['**/node_modules/!(.contentlayer)/**/*'], |
| 41 | } |
| 42 | |
| 43 | config.plugins!.push(new ContentlayerWebpackPlugin(pluginOptions)) |
| 44 | |
| 45 | // NOTE workaround for https://github.com/vercel/next.js/issues/17806#issuecomment-913437792 |
| 46 | // https://github.com/contentlayerdev/contentlayer/issues/121 |
| 47 | config.module?.rules?.push({ |
| 48 | test: /\.m?js$/, |
| 49 | type: 'javascript/auto', |
| 50 | resolve: { |
| 51 | fullySpecified: false, |
| 52 | }, |
| 53 | }) |
| 54 | |
| 55 | if (typeof nextConfig.webpack === 'function') { |
| 56 | return nextConfig.webpack(config, options) |
| 57 | } |
| 58 | |
| 59 | return config |
| 60 | }, |
| 61 | } |
| 62 | } |
| 63 |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…