Skip to content

How to configure vue application properly to use decorator pattern? #12971

Closed Answered by maifeeulasad
maifeeulasad asked this question in Help/Questions

You must be logged in to vote

Putting it here if someone struggles with it in future:

Since you are using TypeScript, you need to add the experimentalDecorators field in the tsconfig.app.json file as follows:

{
  "extends": "@vue/tsconfig/tsconfig.dom.json",
  "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
  "exclude": ["src/**/__tests__/*"],
  "compilerOptions": {
    "experimentalDecorators": true,
    "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",

    "paths": {
      "@/*": ["./src/*"]
    }
  }
}

The documentation on Decorators can be found here: decorators.

The Vite documentation also states that the experimentalDecorators field affects the transpilation result: vite#typescript

r…

Replies: 1 comment

You must be logged in to vote
0 replies
Answer selected by maifeeulasad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant