Closed andylacko closed 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.
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.
esbuild doesn't support decorators
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