mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 17:07:22 +00:00
chore: improve prepare script
This commit is contained in:
parent
e053eefad5
commit
05f8a29060
@ -1,5 +1,6 @@
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import fg from 'fast-glob'
|
||||
import fs from 'fs-extra'
|
||||
import { execa } from 'execa'
|
||||
|
||||
const dirs = await fg('*', {
|
||||
@ -8,6 +9,13 @@ const dirs = await fg('*', {
|
||||
absolute: true
|
||||
})
|
||||
|
||||
await Promise.all([
|
||||
// clear nuxt build files
|
||||
...dirs.map(dir => fs.remove(`${dir}/.nuxt`)),
|
||||
// clear vite cache
|
||||
...dirs.map(dir => fs.remove(`${dir}/node_modules/.vite`), { force: true })
|
||||
])
|
||||
|
||||
await Promise.all(
|
||||
dirs.map(dir => execa('pnpm', ['nuxi', 'prepare'], { cwd: dir }))
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user