You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-npm install the dependencies,
-npm run build
-check the output in dist
What is expected?
const enum declarations should be inlined.
example:
constenumTEST{HELLLO}console.log(TEST.HELLO);//should be transpiled to console.log(0)
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:
Alright, managed to fix , this had to be added to tsconfig : "isolatedModules": false /* Transpile each file as a separate module (similar to 'ts.transpileModule').
question remains if you guys want it as default for tsconfig. Otherwise, feel free to close.
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
// Import Enums
import { MyEnum } from './enums'
export interface MyInterface {
firstProperty: MyEnum,
secondProperty: string,
thirdProperty: number
}
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: