-
-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated declaration files might have redundant types of template refs #5060
Comments
Tree shake is the responsibility of the bundler, not the transpiler. |
I think the output is correct because the refs declared on the template is automatically mounted to the |
The truth is that the transpiler(Typescript Compiler) can tree-shake unused code. If you remove |
I see, but these are two unrelated issues. Anyway,
|
Vue - Official extension or vue-tsc version
2.1.10
VSCode version
Vue version
3.5.13
TypeScript version
5.5.4
System Info
No response
package.json dependencies
No response
Steps to reproduce
Run
npx vue-tsc
to genereate .d.ts filesWhat is expected?
If template refs aren't exposed as public, their types should be 'tree-shaken' from generated .d.ts files.
What is actually happening?
The type of
barRef
is contained in the generated fileFoo.vue.d.ts
, but actually it or its properties aren't exposed fromFoo.vue
with slot or defineExpose.Link to minimal reproduction
https://stackblitz.com/edit/stackblitz-starters-jtpv84
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: