Skip to content

Commit 1668284

Browse files
committed
fix(module): re-parse contents when change is detected in parser options
1 parent 36953f5 commit 1668284

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/module.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ async function processCollectionItems(nuxt: Nuxt, collections: ResolvedCollectio
211211
const db = localDatabase(options._localDatabase!.filename)
212212
const databaseContents = db.fetchDevelopmentCache()
213213

214+
const configHash = hash({
215+
mdcHighlight: nuxt.options.mdc?.highlight,
216+
contentBuild: options.build?.markdown,
217+
})
218+
214219
const infoCollection = collections.find(c => c.name === '_info')!
215220

216221
const startTime = performance.now()
@@ -247,7 +252,7 @@ async function processCollectionItems(nuxt: Nuxt, collections: ResolvedCollectio
247252
await Promise.all(chunk.map(async (key) => {
248253
const keyInCollection = join(collection.name, collection.source?.prefix || '', key)
249254
const content = await readFile(join(cwd, key), 'utf8')
250-
const checksum = getContentChecksum(content)
255+
const checksum = getContentChecksum(configHash + content)
251256
const cache = databaseContents[keyInCollection]
252257

253258
let parsedContent

0 commit comments

Comments
 (0)