The main difference is that your netlify.toml would probably be less complicated If you want your function to have its own dependencies aside from the root package.json, you’d do something like this:
Thank you, my use case was a mailer function with a transactional html email template for a gatsby site which worked in dev but not after deploy. I spent 3 days on this issue because I could not find any clear documentation on how to load files with functions for a gatsby site. First I used netlify-lambda which led me nowhere, finally today I switched to netlify-cli and implemented your solution and it worked! I am sharing here my netlify.toml for reference.