> 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://beyerleinf.gitbook.io/esbuild-azure-functions/getting-started.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
