Getting started

esbuild-azure-functions is a ✨blazingly fast✨ build tool for Azure Functions.

A note about code splitting: There currently is an open issue in the esbuild GitHub repo (evanw/esbuild#399) which describe a bug with the code splitting feature of esbuild. Please check the Troubleshooting section of you think you have this issue.

Installation

npm i esbuild-azure-functions

If you only plan on using the CLI, you can also run it with npx

npx esbuild-azure-functions [-c <config location>]

The CLI expects a config file called esbuild-azure-functions.config.json in the directory you are running it from. You can specify a different config location with the -c | --config flag. Refer to the Configuration page for config options.

For detailed usage, refer to the documentation for Build API and the Watch API.

Configure your Azure Functions project

This step is very important!

By default, the file extension of output files is set to .mjs. This is because the Azure Functions runtime requires this (see Microsoft Docs). You need to change the scriptFile property of your function.json files accordingly.

Last updated