]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix: add __vapor flag in SSR script
authordaiwei <daiwei521@126.com>
Thu, 14 Aug 2025 08:02:08 +0000 (16:02 +0800)
committerdaiwei <daiwei521@126.com>
Thu, 14 Aug 2025 08:54:17 +0000 (16:54 +0800)
packages/compiler-sfc/src/compileScript.ts

index 54ca260bdd6f48d58686d3af24bf939dc9346372..686747458e0de2a7d5d7c82464fb5b0635e9126d 100644 (file)
@@ -980,6 +980,11 @@ export function compileScript(
     ctx.hasDefineExposeCall || options.inlineTemplate ? `` : `  __expose();\n`
   // wrap setup code with function.
   if (ctx.isTS) {
+    // in SSR, always use defineComponent, so __vapor flag is required
+    if (ssr && vapor) {
+      runtimeOptions += `\n  __vapor: true,`
+    }
+
     // for TS, make sure the exported type is still valid type with
     // correct props information
     // we have to use object spread for types to be merged properly