jhipster / generator-jhipster-nodejs

A NodeJS blueprint that creates the backend using NestJS
https://www.npmjs.com/package/generator-jhipster-nodejs
Apache License 2.0
256 stars 79 forks source link

Try to reduce NHipster per project disk size (actually around 800MB) #199

Closed JavierFuentes closed 3 years ago

JavierFuentes commented 3 years ago

Is your feature request related to a problem? Please describe. I think, a new clean project disk size in nHipster is too big (around 800MB)...

I've seen that: _./myProject/nodemodules folder has a disk size around 500MB. _./myProject/server/nodemodules folder has a disk size around 200MB again...

Additionally, my global nodejs node_modules folder has a disk size around 250MB more... I use nvm to change node version when I need...

I wonder if there is not a way of reduce disk size reusing all this libraries.

Describe the solution you'd like Reuse global node installation and node_modules folders between client and server inside one nHipster project.

ghost commented 3 years ago

Hi @JavierFuentes thanks for the question. So, I can tell you that there is a reason as I have designed NHipster with two node_modules (and not only one that includes all libraries). NHipster allows you to generate an app with server and/or client side. The two layers are indipendent, so you might generate only one or both (ans they work also separately) . Besides the first node_modules is inherited by jhipster client generation, while the server/node_modules is the nodejs backend generated from NHipster. Then I can say that the server npm libraries are for the 80% different from the client root node_modules. The last option to use globally npm dependencies from your system nodejs installation is not possibile (or it could raise build breaks) for the npm architecture (it is not considerable as Maven that reuses a global repository)

ghost commented 3 years ago

However, after building the client side (or server if you choose prod build), you can run the entire application without using the two node_modules. Please read the README.md and server README.md generated after NHipster running.

ghost commented 3 years ago

If there aren't other questions, I consider close this ticket. However, feel you free to comment or open other issues. You are welcome!