Skip to content
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

Need to disable vite's built-in TS support #85

Open
ef4 opened this issue Sep 26, 2024 · 1 comment
Open

Need to disable vite's built-in TS support #85

ef4 opened this issue Sep 26, 2024 · 1 comment

Comments

@ef4
Copy link
Contributor

ef4 commented Sep 26, 2024

Once we add a typescript option to the blueprint, we need to make sure that the vite.config.mjs includes:

  esbuild: {
    exclude: /\.m?ts$/,
  },

Without this, Vite's built-in TS transpiler will do the wrong thing before our babel config has a chance to run. We want to handle TS along with the rest of babel.

An example of "the wrong thing" is decorators. We want them to be handled by decorator-transforms in babel, not esbuild's typescript implementation. Another example is class fields: I've seen the TS implementation of class fields break ember-concurrency/async-arrow-task-transform.

@tcjr
Copy link

tcjr commented Oct 4, 2024

Thank you so much for this.

Every time I've tried to use vite, I would eventually hit an error saying ERROR: TypeScript experimental decorators can only be used with class declarations. This error was raised from the vite:esbuild plugin. Since (non-decorator) TypeScript generally "worked", I did not even consider that this was the route to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants