▲ 21 r/nestjs
I built a Vite plugin that lets you run NestJS through Vite. Native ESM, plugin ecosystem, and Swagger metadata out of the box
Hey everyone! I just published vite-plugin-nestjs: a Vite plugin that replaces the NestJS CLI as your dev/build tool.
Why?
The NestJS CLI uses its own compiler pipeline (ts-jest, SWC, etc.), which means you're locked out of the Vite plugin ecosystem. I wanted to use Vite plugins in a NestJS project and couldn't find a clean way to do it, so I built one.
What it does:
- Runs your NestJS app through Vite's dev server, your controllers are available at
localhost:5173with full Vite support - Gives you access to the entire Vite plugin ecosystem in your backend project
- Automatically detects
@nestjs/swaggerin yournest-cli.jsonand generates Swagger metadata before any request is handled, no manual step required vite buildbundles your Nest app as an SSR Node.js module you can run withnode dist/main.js- npm: https://www.npmjs.com/package/vite-plugin-nestjs
- GitHub: https://github.com/Alan-Gomes/vite-plugin-nestjs
Would love feedback, bug reports, or ideas. Happy to answer any questions!
u/alangomes_ — 5 days ago