# 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](https://beyerleinf.gitbook.io/esbuild-azure-functions/configuration) page for config options.

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

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

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

The question should be specific, self-contained, and written in natural language.
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.
