diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index 99f33959159..6220f860f16 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -59,6 +59,24 @@ return { n, get x() { return x } } }" `; +exports[`SFC compile + + + `) + assertCode(content) + }) }) describe('imports', () => { diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index f05926df922..c9fe242b25f 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -1116,6 +1116,7 @@ export function compileScript( optionProperties = defaultExport.declaration.properties } else if ( defaultExport.declaration.type === 'CallExpression' && + defaultExport.declaration.arguments[0] && defaultExport.declaration.arguments[0].type === 'ObjectExpression' ) { optionProperties = defaultExport.declaration.arguments[0].properties