Skip to content

Commit

Permalink
fix: refresh content-index on nitro start
Browse files Browse the repository at this point in the history
  • Loading branch information
Barbapapazes committed Mar 5, 2023
1 parent 413e418 commit 79c58a3
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 79c58a3

Please sign in to comment.