feat(nuxi): clear cache on upgrade (#2936)

This commit is contained in:
Daniel Roe 2022-01-26 17:25:11 +00:00 committed by GitHub
parent 00e8a6e9d4
commit 6e06d2b4c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -44,6 +44,9 @@ export default defineNuxtCommand({
execSync(`${packageManager} install`, { stdio: 'inherit' })
} else {
consola.info('Upgrading nuxt...')
await fsp.rmdir('node_modules/.cache', { recursive: true })
await fsp.rmdir(resolve(rootDir, '.nuxt'), { recursive: true })
await fsp.rmdir('node_modules/.vite', { recursive: true })
execSync(`${packageManager} ${packageManager === 'yarn' ? 'add' : 'install'} -D nuxt3@latest`, { stdio: 'inherit' })
}