Skip to content

Commit

Permalink
fix: refresh content-index on nitro start (#1947)
Browse files Browse the repository at this point in the history
  • Loading branch information
Barbapapazes committed Mar 6, 2023
1 parent 9330e22 commit e1506ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,9 @@ export default defineNuxtModule<ModuleOptions>({
// Register ws url
nitro.options.runtimeConfig.public.content.wsUrl = url.replace('http', 'ws')

// Remove content Index to force fresh index when nitro start (after a pull or a change without started Nuxt)
await nitro.storage.removeItem('cache:content:content-index.json')

// Watch contents
await nitro.storage.watch(async (event: WatchEvent, key: string) => {
// Ignore events that are not related to content
Expand Down

0 comments on commit e1506ed

Please sign in to comment.