> ## Documentation Index
> Fetch the complete documentation index at: https://vuemail.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Building

> How we build each package before publishing

We use [tsdown](https://tsdown.dev) to build the packages. The preview app of `@vuemaildev/ui` is built with [Vite](https://vite.dev),
and `@vuemaildev/editor` compiles its `.vue` files with `unplugin-vue`.

To build a package run:

```bash package/* (ex: packages/render) theme={null}
pnpm build
```

Running `pnpm build` on the root of the workspace builds every package with [turborepo](https://vuemail.dev/docs/contributing/codebase-overview.md#turborepo),
in the order they depend on each other.

Building each package runs `tsdown` with the settings in its `tsdown.config.ts`. `@vuemaildev/vuemail` and `@vuemaildev/render` are built as both [ESM](https://nodejs.org/api/esm.html) and
[CJS](https://nodejs.org/docs/latest/api/modules.html), along with the type definitions exported from the entry point, `src/index.ts`, without bundling `vue`, which can cause issues.

### Why build before publishing?

We build the packages before publishing for a few reasons:

1. All the exported types can be imported from the same place the JavaScript is imported
2. We have proper [CommonJS](https://nodejs.org/docs/latest/api/modules.html#modules-commonjs-modules)
   and [ES Modules](https://nodejs.org/api/esm.html#modules-ecmascript-modules) support
3. Code that isn't exported is not published or downloaded


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.