Skip to content

Commit

Permalink
fix(module): re-parse contents when change is detected in parser options
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Oct 31, 2024
1 parent 36953f5 commit 1668284
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ async function processCollectionItems(nuxt: Nuxt, collections: ResolvedCollectio
const db = localDatabase(options._localDatabase!.filename)
const databaseContents = db.fetchDevelopmentCache()

const configHash = hash({
mdcHighlight: nuxt.options.mdc?.highlight,
contentBuild: options.build?.markdown,
})

const infoCollection = collections.find(c => c.name === '_info')!

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

let parsedContent
Expand Down

0 comments on commit 1668284

Please sign in to comment.