Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
JustinKeller opened this issue Jul 22, 2023 · 0 comments · May be fixed by #2810
Open
1 task done

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

JustinKeller opened this issue Jul 22, 2023 · 0 comments · May be fixed by #2810

Comments

@JustinKeller
Copy link

I'm submitting a...

  • 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 added a commit to JustinKeller/docs.nestjs.com that referenced this issue Jul 27, 2023
Bundling node_modules with webpack can cause issues.

fix nestjs#2806
@JustinKeller JustinKeller linked a pull request Jul 27, 2023 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant