docs.nestjs.com icon indicating copy to clipboard operation
docs.nestjs.com copied to clipboard

Warn against bundling node_modules with webpack for Node.js apps on serverless FAQ page

Open JustinKeller opened this issue 1 year ago • 0 comments

I'm submitting a...

  • [x] Documentation issue or request

Current behavior

On the Serverless FAQ page there is mention of using webpack and bundling node_modules to help with bootstrap time.

However, instead of using the default webpack configuration that Nest CLI ships with, we'll make sure to bundle all dependencies (node_modules) together, as follows

Expected behavior

Have a hint or warning that it's not recommended to bundle node_modules with Node.js applications, and that the example is for demonstration purposes only.

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

While trying to implement this to improve init durations on Lambda, I came across some of the issues mentioned in this ticket and a comment which recommends against bundling Node.js applications with node_modules. The motivation for this change is to prevent others from spending time trying to implement this while they'll likely run into the same issue. I would be happy to try submitting a PR for this if the maintainer(s) agree with the change.

JustinKeller avatar Jul 22 '23 19:07 JustinKeller