mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +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 { fileURLToPath } from 'node:url'
|
||||||
import fg from 'fast-glob'
|
import fg from 'fast-glob'
|
||||||
|
import fs from 'fs-extra'
|
||||||
import { execa } from 'execa'
|
import { execa } from 'execa'
|
||||||
|
|
||||||
const dirs = await fg('*', {
|
const dirs = await fg('*', {
|
||||||
@ -8,6 +9,13 @@ const dirs = await fg('*', {
|
|||||||
absolute: true
|
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(
|
await Promise.all(
|
||||||
dirs.map(dir => execa('pnpm', ['nuxi', 'prepare'], { cwd: dir }))
|
dirs.map(dir => execa('pnpm', ['nuxi', 'prepare'], { cwd: dir }))
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user