From 6806facfa1f46b1e30b941aae5e4e883ec2593d7 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 19 Nov 2020 16:58:07 -0500 Subject: [PATCH] wip: fix default export side effect handling --- packages/compiler-sfc/src/compileScript.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 31e92fb0..918e3f8d 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -930,8 +930,7 @@ export function compileScript( `\n${hasAwait ? `async ` : ``}function setup(${args}) {\n` ) s.append( - `\n/*#__PURE__*/ Object.assign(${defaultTempVar}, {${runtimeOptions}\n setup\n})\n` + - `export default ${defaultTempVar}` + `\nexport default /*#__PURE__*/ Object.assign(${defaultTempVar}, {${runtimeOptions}\n setup\n})\n` ) } else { s.prependLeft(