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

Function webpack

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

Source from the content-addressed store, hash-verified

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

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…