-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Typescript const enums not compiled correctly #3376
Comments
microsoft/TypeScript#10879 (comment) Alright, managed to fix , this had to be added to tsconfig : |
Hi @jestarray! I ran into a similar issue this last week and this thread was helpful. We ended up separating our enum "types" into a different file. (a plain .ts file) Then we imported that file into our types file. It fixed the problem. Here's a watered down version: types.d.ts
enums.ts
That was suggested by Lukas Behal. |
Version
3.3.0
Reproduction link
https://github.com/jestarray/const-enum-vue
Environment info
Steps to reproduce
-npm install the dependencies,
-npm run build
-check the output in dist
What is expected?
const enum declarations should be inlined.
example:
What is actually happening?
It's transpiled into
console.log(TEST.HELLO)
instead.I have a const enum of keyboard events and event key names that I need inlined correctly. Followed some solutions of
ts-loader
since vue cli uses it under the hood but no luck.The text was updated successfully, but these errors were encountered: