perf(head): disable @vueuse/head polyfill by default (#20131)

This commit is contained in:
Harlan Wilton 2023-04-07 20:10:35 +07:00 committed by GitHub
parent c65c5a8e79
commit 0c9823eb87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -146,7 +146,7 @@ export default defineUntypedSchema({
* *
* This can be disabled for most Nuxt sites to reduce the client-side bundle by ~0.5kb. * This can be disabled for most Nuxt sites to reduce the client-side bundle by ~0.5kb.
*/ */
polyfillVueUseHead: true, polyfillVueUseHead: false,
/** Allow disabling Nuxt SSR responses by setting the `x-nuxt-no-ssr` header. */ /** Allow disabling Nuxt SSR responses by setting the `x-nuxt-no-ssr` header. */
respectNoSSRHeader: false, respectNoSSRHeader: false,

View File

@ -40,7 +40,7 @@ describe.skipIf(isWindows || process.env.ECOSYSTEM_CI)('minimal nuxt application
it('default server bundle size', async () => { it('default server bundle size', async () => {
stats.server = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir) stats.server = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
expect(roundToKilobytes(stats.server.totalBytes)).toMatchInlineSnapshot('"92k"') expect(roundToKilobytes(stats.server.totalBytes)).toMatchInlineSnapshot('"91k"')
const modules = await analyzeSizes('node_modules/**/*', serverDir) const modules = await analyzeSizes('node_modules/**/*', serverDir)
expect(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2648k"') expect(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2648k"')

View File

@ -190,6 +190,7 @@ export default defineNuxtConfig({
} }
}, },
experimental: { experimental: {
polyfillVueUseHead: true,
renderJsonPayloads: true, renderJsonPayloads: true,
respectNoSSRHeader: true, respectNoSSRHeader: true,
clientFallback: true, clientFallback: true,