diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index 473ebd4e0b9..d13dab82e3e 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 3cca3c2f436..00e2e7ae00c 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -1110,6 +1110,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