Using Vite for backend
Asked Answered
D

2

41

We are using Vite for our frontend (inside SvelteKit) and it works nicely with creating SSR and frontend code.

I especially like the prebundling of 3rd party packages via esbuild.

Can someone tell me if it’s possible to use the Vite bundling pipeline for a backend-only project (nodejs server based on koa)?

Dodson answered 11/10, 2021 at 9:0 Comment(0)
O
26

You can try vite-plugin-node. This vite plugin supports multiple nodejs frameworks out of the box including koa. I have created a simple express app with it in typescript which worked fine for me. One downside is the plugin is fairly new and still in its early stage, so you may not want to use it in a serious production app.

Ore answered 21/10, 2021 at 17:48 Comment(1)
Just FYI: that plugin seems to be unmaintainedBitthia
S
17

check out vite-node

it is a runtime for node that uses vite

Scission answered 31/12, 2022 at 18:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.