MCPcopy Create free account
hub / github.com/contentlayerdev/contentlayer / webpack

Function webpack

packages/next-contentlayer/src/index-cjs.ts:37–61  ·  view source on GitHub ↗
(config: webpack.Configuration, options: any)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…