🏗️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:
Each microservice has a build script that simply runs a global esbuild configuration file, creating a bundle in the <microservice-name>/dist
folder.
The output bundle is a single standalone JavaScript file containing all the internal and external dependency needed.
Building a project
The building process of a Multijet project is very easy thanks to Turborepo (to learn more head to Turborepo configuration section).
To build your project, in the root of your project run this command:
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.
Last updated