-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Feature Request] Try resolve const enum from .d.ts #3359
Comments
Related issue: vitest-dev/vitest#1650 |
maybe duplicate: #2298 (comment) |
Yes, this is the problem. Here's Vite's documentation about this from the link you pasted:
If you set I'm closing this issue because I don't plan on implementing this in esbuild. While it's sort of possible to make this work in some simple cases, emulating this correctly breaks down in more complex cases without esbuild replicating TypeScript's type system, which I'm not going to do. I have to draw a "line in the sand" somewhere and I have decided that for esbuild, the line is that esbuild does not attempt to interpret type annotations (and everything in a |
Thank you for your response, it makes perfect sense. |
I'd like to use enums here. I think an enum like ``` enum QuerystringKeys { SelectedMovieId = 'selected', ... } ``` provides much better editor hinting for the developer. Adding them to `includes` in tsconfig means they don't need to be imported to be used as a variable ``` useQuerystring(QuerystringKeys.SelectedMovieId); ``` but I ran into this issue evanw/esbuild#3359
Problem
I have a project base on
@vue/reactivity
, and@vue/reactivity
contains const enum. I want to useesbuild
to build my project, but I can't, becauseesbuild
can't resolve const enum from@vue/reactivity
. I'm guessing this is because the const enum only exist in the type file and not source file.Request
So, is it possible to resolve package's const enum from the package's type file?
The text was updated successfully, but these errors were encountered: