netlify-plugin-inline-functions-env icon indicating copy to clipboard operation
netlify-plugin-inline-functions-env copied to clipboard

feature request: include & exclude function paths

Open juanpprieto opened this issue 3 years ago • 2 comments

Thanks for the plugin.

Would be great if you could add include and exclude also for function names / paths and not just for env vars.

My problem is that in a nextjs, @netlify/plugin-nextjs generates a huge amount of lambdas and their requires (121 to be precise in my case). Some of these functions, are also pretty massive 500Kb to mbs depending how heavy a given "api" route is.

In my simple use case, I want to pass only one env bar netlify's process.env.BRANCH to just one single function, but the plugin is processing all the hundredths of .js files via babel which takes a huge amount of time killing my build minutes.

Anyway, thought I'd throw in here since nextjs is becoming pretty popular within netlify.

thanks again. JP

juanpprieto avatar May 10 '21 22:05 juanpprieto

Happy to submit a PR.

juanpprieto avatar May 10 '21 23:05 juanpprieto

Just wanted to bump this feature request! We're also looking for a way to workaround the underlying platform limitation that this plugin solves with Next.js and hit a wall with the latest version of the Netlify build plugin: https://github.com/netlify/netlify-plugin-nextjs/issues/751

mgburns avatar Nov 02 '21 16:11 mgburns