diff --git a/package.json b/package.json index e94789865e9..26e4f5f6ca6 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "pug": "^3.0.3", "puppeteer": "~24.16.2", "rimraf": "^6.0.1", - "rollup": "4.50.1", + "rollup": "^4.52.5", "rollup-plugin-dts": "^6.2.3", "rollup-plugin-esbuild": "^6.2.1", "rollup-plugin-polyfill-node": "^0.13.0", diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 36ac6547709..fe413753548 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -1021,6 +1021,11 @@ export function compileScript( : '' // 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 diff --git a/packages/compiler-ssr/__tests__/ssrVIf.spec.ts b/packages/compiler-ssr/__tests__/ssrVIf.spec.ts index b544adadcf3..7867a4b5fb5 100644 --- a/packages/compiler-ssr/__tests__/ssrVIf.spec.ts +++ b/packages/compiler-ssr/__tests__/ssrVIf.spec.ts @@ -82,15 +82,15 @@ describe('ssr: v-if', () => { test('