> For the complete documentation index, see [llms.txt](https://beyerleinf.gitbook.io/esbuild-azure-functions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://beyerleinf.gitbook.io/esbuild-azure-functions/getting-started.md).

# Getting started

{% hint style="warning" %}
A note about code splitting:\
There currently is an open issue in the esbuild GitHub repo ([evanw/esbuild#399](https://github.com/evanw/esbuild/issues/399)) which describe a bug with the code splitting feature of esbuild. Please check the Troubleshooting section of you think you have this issue.
{% endhint %}

## Installation

{% tabs %}
{% tab title="npm" %}

```
npm i esbuild-azure-functions
```

{% endtab %}

{% tab title="yarn" %}

```
yarn add esbuild-azure-functions
```

{% endtab %}
{% endtabs %}

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](/esbuild-azure-functions/configuration.md) page for config options.

For detailed usage, refer to the documentation for [Build API](/esbuild-azure-functions/api/build-api.md) and the [Watch API](/esbuild-azure-functions/api/watch-api.md).

## Configure your Azure Functions project

{% hint style="danger" %}
This step is very important!
{% endhint %}

By default, the file extension of output files is set to `.mjs`. This is because the Azure Functions runtime requires this ([see Microsoft Docs](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node?tabs=v2-v3-v4-export%2Cv2-v3-v4-done%2Cv2%2Cv2-log-custom-telemetry%2Cv2-accessing-request-and-response%2Cwindows-setting-the-node-version#ecmascript-modules)). You need to change the `scriptFile` property of your *function.json* files accordingly.

<br>
