netlify / netlify/cli

Document ignored_node_modules option in netlify.toml

Open
#4,684 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: docs area: functions type: feature
Dominant language
TypeScript
Stars
1.9k
Forks
474
Avg merge
23h 30m
Merged PRs (30d)
53

Description

Which problem is this feature request solving?

I spent a day trying to figure out how to exclude a module from a function bundle that was over 50MB. Puppeteer doesn't leave much room and the aws-sdk v3 (despite it's tree-shaken smaller size than v2) tipped the scale and the function could not deploy.

I found out Lambdas have aws-sdk included by default so I wanted to exclude the redundant module from the bundle. I searched through the documentation, Netlify forums and poked around in the Netlify CLI source code. However, it wasn't until I found this config on zip-it-and-ship-it that I realized what to search for in the CLI source code. I found it here.

This option (as well as a number of other newer options like [dev] envFiles) are undocumented.

Describe the solution you'd like

Update the following documentation to include ignored_node_modules under the [functions] heading.

https://docs.netlify.com/configure-builds/file-based-configuration/

As far as I can tell, the docs are not open source so I can't even make a PR to fix them.

Pull request (optional)
  • I can submit a pull request.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the file-based configuration documentation and the referenced src/lib/functions/config.js entry point to confirm how ignored_node_modules is handled. Done means the [functions] documentation includes this option, although the issue notes that the documentation repository is not open source.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.