From 489a286d7d6e3492a475abfc4f5690e15f94e085 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 29 Aug 2022 09:56:42 +0100 Subject: [PATCH 1/2] fix(vite): remove client manifest.json from public dir --- packages/vite/src/manifest.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/vite/src/manifest.ts b/packages/vite/src/manifest.ts index 30f715cc3d8..86f85640948 100644 --- a/packages/vite/src/manifest.ts +++ b/packages/vite/src/manifest.ts @@ -52,4 +52,8 @@ export async function writeManifest (ctx: ViteBuildContext, css: string[] = []) await fse.writeFile(resolve(serverDist, 'client.manifest.json'), JSON.stringify(manifest, null, 2), 'utf8') await fse.writeFile(resolve(serverDist, 'client.manifest.mjs'), 'export default ' + JSON.stringify(manifest, null, 2), 'utf8') + + if (!ctx.nuxt.options.dev) { + fse.removeSync(resolve(clientDist, 'manifest.json')) + } } From 53cb0448bac46f8963f37ef78fd5f55c8db83b43 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 29 Aug 2022 10:35:00 +0100 Subject: [PATCH 2/2] refactor: use async version --- packages/vite/src/manifest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/manifest.ts b/packages/vite/src/manifest.ts index 86f85640948..b251a7f718d 100644 --- a/packages/vite/src/manifest.ts +++ b/packages/vite/src/manifest.ts @@ -54,6 +54,6 @@ export async function writeManifest (ctx: ViteBuildContext, css: string[] = []) await fse.writeFile(resolve(serverDist, 'client.manifest.mjs'), 'export default ' + JSON.stringify(manifest, null, 2), 'utf8') if (!ctx.nuxt.options.dev) { - fse.removeSync(resolve(clientDist, 'manifest.json')) + await fse.rm(resolve(clientDist, 'manifest.json'), { force: true }) } }