cli icon indicating copy to clipboard operation
cli copied to clipboard

Document ignored_node_modules option in netlify.toml

Open Soviut opened this issue 3 years ago • 0 comments

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.

Soviut avatar Jun 09 '22 06:06 Soviut