DEV Community

Discussion on: Exploring NestJS Workspace

Collapse
 
leob profile image
leob

Seems a pity that just because you're adding a library to your project you now suddenly need Webpack and its complexities, instead of just simply TSC. Why?

Collapse
 
santoshyadavdev profile image
Santosh Yadav

Let me try to explain why it is needed, when we create monorepo these are 2 separate workspaces, both having there own tsconfig so they will be compiled separately, so when build is created the final main.js has to know both or multiple files which are included via a library this is where webpack is required.

Collapse
 
leob profile image
leob

Right, this is what you would probably solve in Express.js with a separate npm component. But that's arguable more hassle, I'll grant you that. Do you think that Nest.js also has advantages for devs who don't have a background in Angular and or .Net/Java and so on?

Thread Thread
 
santoshyadavdev profile image
Santosh Yadav

Every framework requires has some learning curve, what I like about NestJS is for large enterprise application it provides a clean architecture, you don't have to think which code needs to be added where. While using other frameworks with JavaScript developers do it as per there convenience, every organization may have different way to architect your app, which is challenge when you change the job.

Thread Thread
 
leob profile image
leob • Edited

Makes total sense! So, it might be more useful/compelling in a corporate setting than for a solo dev/hobbyist or small scale project. (but maybe even there)