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

Function runContentlayerDev

packages/next-contentlayer/src/plugin.ts:17–30  ·  view source on GitHub ↗
({ configPath }: NextPluginOptions)

Source from the content-addressed store, hash-verified

15let contentlayerInitialized = false
16
17const runContentlayerDev = async ({ configPath }: NextPluginOptions) => {
18 if (contentlayerInitialized) return
19 contentlayerInitialized = true
20
21 await pipe(
22 core.getConfigWatch({ configPath }),
23 S.tapSkipFirstRight(() => T.log(`Contentlayer config change detected. Updating type definitions and data...`)),
24 S.tapRight((config) => (config.source.options.disableImportAliasWarning ? T.unit : T.fork(core.validateTsconfig))),
25 S.chainSwitchMapEitherRight((config) => core.generateDotpkgStream({ config, verbose: false, isDev: true })),
26 S.tap(E.fold((error) => T.log(errorToString(error)), core.logGenerateInfo)),
27 S.runDrain,
28 runMain,
29 )
30}
31
32const runContentlayerBuild = async ({ configPath }: NextPluginOptions) => {
33 if (contentlayerInitialized) return

Callers 1

runBeforeWebpackCompileFunction · 0.85

Calls 1

errorToStringFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…