fix(compiler-sfc): ensure script setup lang=ts output is tree-shakable

This commit is contained in:
Evan You
2021-09-01 12:40:36 -04:00
parent 935b4e2210
commit b89ff9291e
3 changed files with 28 additions and 28 deletions

View File

@@ -1148,14 +1148,14 @@ export function compileScript(
`\n${hasAwait ? `async ` : ``}function setup(${args}) {\n`
)
s.append(
`\nexport default ${helper(
`\nexport default /*#__PURE__*/${helper(
`defineComponent`
)}({${def}${runtimeOptions}\n setup})`
)
} else {
s.prependLeft(
startOffset,
`\nexport default ${helper(
`\nexport default /*#__PURE__*/${helper(
`defineComponent`
)}({${def}${runtimeOptions}\n ${
hasAwait ? `async ` : ``