From 6b4ef3b9fb6d70dbd9033b4f3fc7bab69275440d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=BF=97=E8=BF=9C?= Date: Mon, 23 Aug 2021 17:23:17 +0800 Subject: [PATCH 1/2] fix(compiler-sfc): + + `) + expect(content).toMatch(/const __default__[\S\s]*\.\.\.__default__/m) + assertCode(content) + }) }) describe('imports', () => { diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 9d1775407c9..19fa772d74d 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -1105,15 +1105,27 @@ export function compileScript( // wrap setup code with function. // export the content of `) + // ensure __default__ is declared before used expect(content).toMatch(/const __default__[\S\s]*\.\.\.__default__/m) assertCode(content) })