refactor(compiler-sfc): improve script setup import expose heuristics

This commit is contained in:
Evan You
2021-07-22 12:53:08 -04:00
parent 5a3ccfd914
commit f0ca233d8b
5 changed files with 83 additions and 19 deletions

View File

@@ -206,7 +206,7 @@ return { x }
exports[`SFC compile <script setup> imports imports not used in <template> should not be exposed 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { FooBar, FooBaz, FooQux, vMyDir, x, y } from './x'
import { FooBar, FooBaz, FooQux, vMyDir, x, y, z } from './x'
export default _defineComponent({
setup(__props, { expose }) {
@@ -214,7 +214,7 @@ export default _defineComponent({
const fooBar: FooBar = 1
return { fooBar, FooBaz, FooQux, vMyDir, x }
return { fooBar, FooBaz, FooQux, vMyDir, x, z }
}
})"