File tree 1 file changed +4
-3
lines changed
packages/compiler-sfc/src
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ export function compileScript(
175
175
const scriptLang = script && script . lang
176
176
const scriptSetupLang = scriptSetup && scriptSetup . lang
177
177
const vapor = sfc . vapor || options . vapor
178
+ const ssr = options . templateOptions ?. ssr
178
179
179
180
if ( ! scriptSetup ) {
180
181
if ( ! script ) {
@@ -749,7 +750,7 @@ export function compileScript(
749
750
if (
750
751
sfc . cssVars . length &&
751
752
// no need to do this when targeting SSR
752
- ! options . templateOptions ?. ssr
753
+ ! ssr
753
754
) {
754
755
ctx . helperImports . add ( CSS_VARS_HELPER )
755
756
ctx . helperImports . add ( 'unref' )
@@ -859,7 +860,7 @@ export function compileScript(
859
860
} else {
860
861
// inline mode
861
862
if ( sfc . template && ! sfc . template . src ) {
862
- if ( options . templateOptions && options . templateOptions . ssr ) {
863
+ if ( ssr ) {
863
864
hasInlinedSsrRenderFn = true
864
865
}
865
866
// inline render function mode - we are going to compile the template and
@@ -933,7 +934,7 @@ export function compileScript(
933
934
ctx . s . appendRight (
934
935
endOffset ,
935
936
// 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` ,
937
938
)
938
939
}
939
940
You can’t perform that action at this time.
0 commit comments