Skip to content

Instantly share code, notes, and snippets.

@damieng
Created May 13, 2024 10:08
Show Gist options
  • Save damieng/fde5f5de79bfade008246a33cfbeffb9 to your computer and use it in GitHub Desktop.
Save damieng/fde5f5de79bfade008246a33cfbeffb9 to your computer and use it in GitHub Desktop.
How to delete the content.db for Nuxt2 SSG
{
// Inside your nuxt.config.js
hooks: {
"generate:done": (builder) => {
const options = builder.nuxt.options
const hash = options.publicRuntimeConfig.content.dbHash
const fileName = resolve(options.generate.dir, '_nuxt', 'content', `db-${hash}.json`)
console.log('Deleting content database file:', fileName)
unlinkSync(fileName)
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment