How do I enable an esbuild plugin to be used during a function build?

My lambda function works fine and is building using esbuild now, but I want to enable an esbuild plugin to be used during the function build. Is there a config file I can create (such as build.js) or an option I can enable to setup the esbuild parameters used during the building of a netlify function?

Hi @amberd,

That’s currently not possible. However, you can either:

  1. Build your function’s JavaScript using esbuild locally with the plugins that you want. Then deploy that generated JS file as a function. OR
  2. Create a build plugin that basically does the same thing.

Sorry if I’m too late, but it would be great to have that option as it will result in much simpler build process and cleaner code. Yeah, I ended up bundling html templates into the Functions :dizzy_face: