mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
perf(vite): avoid duplicate JSON.stringify
operation (#24848)
This commit is contained in:
parent
b589314dec
commit
59cac484d9
@ -60,9 +60,9 @@ export async function writeManifest (ctx: ViteBuildContext, css: string[] = [])
|
||||
|
||||
const manifest = normalizeViteManifest(clientManifest)
|
||||
await ctx.nuxt.callHook('build:manifest', manifest)
|
||||
|
||||
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')
|
||||
const stringifiedManifest = JSON.stringify(manifest, null, 2)
|
||||
await fse.writeFile(resolve(serverDist, 'client.manifest.json'), stringifiedManifest, 'utf8')
|
||||
await fse.writeFile(resolve(serverDist, 'client.manifest.mjs'), 'export default ' + stringifiedManifest, 'utf8')
|
||||
|
||||
if (!ctx.nuxt.options.dev) {
|
||||
await fse.rm(manifestFile, { force: true })
|
||||
|
Loading…
Reference in New Issue
Block a user