Created
May 13, 2024 10:08
-
-
Save damieng/fde5f5de79bfade008246a33cfbeffb9 to your computer and use it in GitHub Desktop.
How to delete the content.db for Nuxt2 SSG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// 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