From 0c9823eb87a540edf739dee5f5222e468a3cf8df Mon Sep 17 00:00:00 2001 From: Harlan Wilton Date: Fri, 7 Apr 2023 20:10:35 +0700 Subject: [PATCH] perf(head): disable `@vueuse/head` polyfill by default (#20131) --- packages/schema/src/config/experimental.ts | 2 +- test/bundle.test.ts | 2 +- test/fixtures/basic/nuxt.config.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/schema/src/config/experimental.ts b/packages/schema/src/config/experimental.ts index 858f8d54e1..36162e53cd 100644 --- a/packages/schema/src/config/experimental.ts +++ b/packages/schema/src/config/experimental.ts @@ -146,7 +146,7 @@ export default defineUntypedSchema({ * * 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. */ respectNoSSRHeader: false, diff --git a/test/bundle.test.ts b/test/bundle.test.ts index 9098877aaa..7144642151 100644 --- a/test/bundle.test.ts +++ b/test/bundle.test.ts @@ -40,7 +40,7 @@ describe.skipIf(isWindows || process.env.ECOSYSTEM_CI)('minimal nuxt application it('default server bundle size', async () => { 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) expect(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2648k"') diff --git a/test/fixtures/basic/nuxt.config.ts b/test/fixtures/basic/nuxt.config.ts index 6a11e29bba..a1e40b709d 100644 --- a/test/fixtures/basic/nuxt.config.ts +++ b/test/fixtures/basic/nuxt.config.ts @@ -190,6 +190,7 @@ export default defineNuxtConfig({ } }, experimental: { + polyfillVueUseHead: true, renderJsonPayloads: true, respectNoSSRHeader: true, clientFallback: true,