File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/compiler-sfc/src Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ export function compileScript(
175175 const scriptLang = script && script . lang
176176 const scriptSetupLang = scriptSetup && scriptSetup . lang
177177 const vapor = sfc . vapor || options . vapor
178+ const ssr = options . templateOptions ?. ssr
178179
179180 if ( ! scriptSetup ) {
180181 if ( ! script ) {
@@ -749,7 +750,7 @@ export function compileScript(
749750 if (
750751 sfc . cssVars . length &&
751752 // no need to do this when targeting SSR
752- ! options . templateOptions ?. ssr
753+ ! ssr
753754 ) {
754755 ctx . helperImports . add ( CSS_VARS_HELPER )
755756 ctx . helperImports . add ( 'unref' )
@@ -859,7 +860,7 @@ export function compileScript(
859860 } else {
860861 // inline mode
861862 if ( sfc . template && ! sfc . template . src ) {
862- if ( options . templateOptions && options . templateOptions . ssr ) {
863+ if ( ssr ) {
863864 hasInlinedSsrRenderFn = true
864865 }
865866 // inline render function mode - we are going to compile the template and
@@ -933,7 +934,7 @@ export function compileScript(
933934 ctx . s . appendRight (
934935 endOffset ,
935936 // vapor mode generates its own return when inlined
936- `\n${ vapor ? `` : `return ` } ${ returned } \n}\n\n` ,
937+ `\n${ vapor && ! ssr ? `` : `return ` } ${ returned } \n}\n\n` ,
937938 )
938939 }
939940
You can’t perform that action at this time.
0 commit comments