Creating a TypeScript library inside the monorepo is easy if we use tsup. To configure tsup, we have to set up the entry point. In our case, it's going to be the index.ts file inside the src directory.
We will also specify some extra options for tsup such as generating the types and source maps. We can also output different formats. In this case, we want to output an ESM file and a CommonJS file.