Open
Description
Describe the bug
Given a typescript project with `target: "2022",
"experimentalDecorators": true,
"useDefineForClassFields": false,
the default values for the above settings are false
and true
respectively. This means you can use standard decorators, for example: @property() accessor name: string;
.
However, when running vite dev
, the @property()
code will try to run in the browser, with a syntax error as a result.
Reproduction
Steps to reproduce
No response
System Info
-
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.