> For the complete documentation index, see [llms.txt](https://quinck.gitbook.io/multijet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://quinck.gitbook.io/multijet/configuration/build-configuration.md).

# Build configuration

Building a Node.js multiproject can be a challenging task, especially when you have multiple microservices to manage. Multijet is a framework that helps simplify this process by creating a **separate bundle for each microservice** in your project.

## Bundling a microservice

Multijet uses `esbuild` to create a bundle from a TypeScript microservice, making this process **extremely fast** (often less than 100 milliseconds). Esbuild supports TypeScript natively so there is no need to transpile the microservice first.

The esbuild configuration is located in `<project-root>/configs/esbuild`. The following example is the default configuration file:

{% code title="esbuild.config.js" %}

```javascript
const { build } = require('esbuild')

const [entryPointArg, outfileArg] = process.argv.slice(2)

// if no arguments, by default bundle the 'main.ts' file

const entryPoint = entryPointArg ?? 'main'
const outfile = outfileArg ?? 'main'

build({
    entryPoints: [`src/${entryPoint}.ts`],
    outfile: `dist/${outfile ?? entryPoint}.js`,
    bundle: true,
    platform: 'node',
    logLevel: 'info',
}).catch(() => process.exit(1))
```

{% endcode %}

Each microservice has a [**build script**](/multijet/configuration/microservices-and-libs.md#microservice-configuration) that simply **runs a global esbuild configuration file**, creating a bundle in the `<microservice-name>/dist` folder.

{% hint style="info" %}
The output bundle is a single standalone JavaScript file containing all the internal and external dependency needed.
{% endhint %}

## Building a project

The building process of a Multijet project is very easy thanks to **Turborepo** (to learn more head to [Turborepo configuration](/multijet/configuration/turborepo.md) section).

To build your project, in the root of your project run this command:

```bash
npm run build
```

This command (defined in the project's root `package.json`) will first **check if there are type errors** in each of your libs and microservices and then will run the `build` script of every microservice, **creating a bundle for each one**. All of this is done by **Turborepo** in parallel and with active caching.
