nestjs / nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
https://nestjs.com
MIT License
66.84k stars 7.55k forks source link

Vite as builder for NestJS #10721

Closed andylacko closed 1 year ago

andylacko commented 1 year ago

Is there an existing issue that is already proposing this?

Is your feature request related to a problem? Please describe it

Currently NestJS run on CommonJS modules, there is no way to run ESM with treeshaking and using VITE as build tool. Found https://blog.logrocket.com/getting-started-with-nestjs-vite-esbuild/ , or https://github.com/unlight/nest-vite-node-starter, but it seems like it would break after first update.

Describe the solution you'd like

It would be really nice to migrate from webpack. Maybe there is something working for decorators like https://github.com/anatine/esbuildnx .

Teachability, documentation, adoption, migration strategy

Maybe it should work like you choose in config, you want to use vite

What is the motivation / use case for changing the behavior?

Today JS/TS world has moved to interesting tools like esbuild and Vite and esm. I lack those improvements in NestJS

micalevisk commented 1 year ago

There is a closed Issue discussing about esbuild and ESM stuff

There is also a WIP PR to support ESM.

Not sure if you've seen them already.

Tony133 commented 1 year ago

Here you find the PR (WIP) :https://github.com/nestjs/nest/pull/8736, with discussion of ESM and CJS

Here: https://github.com/nestjs/nest/issues/8669, you can also find the answer for Vite support for NestJS, already been discussed in the past.

kamilmysliwiec commented 1 year ago

esbuild doesn't support decorators