cyco130 / vavite

Develop server-side applications with Vite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vavite for NestJs and Svelte

alphaelf opened this issue · comments

can you make an example for nestjs and svelte?
how can we use svelte as view (add svelte view engine) and hydrate universal rendering?

Hi! I don't know too much about NestJS. I will try to create a basic NestJS example but setting up a view engine with NestJS (or any other framework) is out of scope for vavite. (I'll keep this open until I manage to come up with an example).

@alphaelf, @cyco130 I haven't tested it with svetle, but it works out of the box with nestjs and fastify adapter(so it will work with express adapter to, I think). The only thing is that you need some 'swc' plugin to compile the typescript, since esbuild dont support 'emitDecoratorMetadata' yet. test repo - development branch

@vova-white thank you for the pointer. I should be able to create a bare bones example from your repo soon.

@nitedani contributed two NestJS examples: vanilla and vite-plugin-ssr. You should be able to add a Svelte renderer on top of it.

Don't worry about the initial 404, it happens because NestJS can't boot fast enough, just refresh the browser and it'll work. We're working on solving that problem too.