Subscribe on changes!

feat: simple typescript support

avatar
May 4th 2020

fix #6

avatar
May 5th 2020

This is great, but I think TS's transpilation itself is too slow for dev purposes, especially for a speed-focused dev. server like vite. There are a number of alternative (and much faster) TS -> ESnext compilers available (e.g. Surcrase, esbuild, swc) and I'm still researching what is the best compiler to use in vite.

avatar
May 5th 2020

Also, what's the expected result when TypeScript is being used? Should the server only strip types, and we leave the type checking to an IDE? Or should the server send back 500 errors (or something) to help the dev experience in catching type errors?

avatar
May 6th 2020

Time To Close This PR

avatar
May 6th 2020

I noticed the latest code uses esbuild, for what reason? @yyx990803

avatar
May 6th 2020

@zzetao support minification with esbuild

avatar
May 6th 2020

@zzetao .Sorry. I pull the code just now.Look like esbuild is already integrated.

avatar
May 7th 2020

Closing since we are using esbuild which is faster. It also aligns better with vite's transpile-only scope.

avatar
May 7th 2020

@yyx990803 . I change my pr code with use esbuild yesterday, Maybe you are not pay attention to this.and I find ts still not suppoted after I pull the master code just now.

avatar
May 7th 2020

Oh I didn't realize - but it should actually be fixed already. The rewrite happens after TS transpilation and the logic doesn't need to be duplicated. TS file extension resolution had a bug that is now fixed in ca421cd