From 05f8a290600be42c58c332b86d925012b4e8b0a2 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 1 Sep 2023 16:53:35 +0200 Subject: [PATCH] chore: improve prepare script --- test/prepare.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/prepare.ts b/test/prepare.ts index cee55399c8..396313d307 100644 --- a/test/prepare.ts +++ b/test/prepare.ts @@ -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 })) )