Open ef4 opened 2 months ago
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.
Once we add a typescript option to the blueprint, we need to make sure that the vite.config.mjs includes:
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
.