29

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)?

user3612643
  • 5,096
  • 7
  • 34
  • 55

2 Answers2

21

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.

RHN CHN
  • 384
  • 2
  • 8
10

check out vite-node

it is a runtime for node that uses vite

dionsaur84
  • 101
  • 1
  • 2