vite-plugin-vue-type-imports
vite-plugin-vue-type-imports copied to clipboard
CAN NOT import types from entry file with multiple exports levels
The code below is not working:
Vue
import type { MsgProps } from './types'
defineProps<MsgProps>()
types.ts
export * from './msg'
msg.ts
export interface MsgProps {
msg: string;
}
I got:
[@vue/compiler-sfc] type argument passed to defineProps() must be a literal type, or a reference to an interface or literal type
If I import type { MsgProps } from './msg'
, it works ok.
Reproduce Repo
https://github.com/gaokun/vue3-ts-vite-type-imports
The following syntaxes are not supported currently:
import default
import { a as b }
export default
export * from
This is a known issue, however, the documentation is currently not updated until #15 is merged.
Unfortunenately, this may take a while to fix because I'm not focusing on this project now.
@Zolyn Many thanks for your extremely quick response. And thanks to your work anyway.
Supported in v0.2.2