# mkdist

> Lightweight file-to-file transformer

Latest version **2.4.1** (published 2025-09-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install mkdist
pnpm add mkdist
yarn add mkdist
bun add mkdist
```

Provides the command `mkdist`.

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.4.1 |
| Published | 2025-09-12 |
| First published | 2021-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 13 |
| Unpacked size | 67.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 438 |
| Maintainers | pi0, danielroe |

## Links

- npm: https://www.npmjs.com/package/mkdist
- Repository: https://github.com/unjs/mkdist
- Homepage: https://github.com/unjs/mkdist#readme
- Issues: https://github.com/unjs/mkdist/issues
- npm.io page: https://npm.io/package/mkdist

## Dependencies (13)

- [defu](https://npm.io/package/defu.md) ^6.1.4
- [jiti](https://npm.io/package/jiti.md) ^1.21.7
- [mlly](https://npm.io/package/mlly.md) ^1.8.0
- [citty](https://npm.io/package/citty.md) ^0.1.6
- [pathe](https://npm.io/package/pathe.md) ^2.0.3
- [semver](https://npm.io/package/semver.md) ^7.7.2
- [cssnano](https://npm.io/package/cssnano.md) ^7.1.1
- [esbuild](https://npm.io/package/esbuild.md) ^0.25.9
- [postcss](https://npm.io/package/postcss.md) ^8.5.6
- [pkg-types](https://npm.io/package/pkg-types.md) ^2.3.0
- [tinyglobby](https://npm.io/package/tinyglobby.md) ^0.2.15
- [autoprefixer](https://npm.io/package/autoprefixer.md) ^10.4.21
- [postcss-nested](https://npm.io/package/postcss-nested.md) ^7.0.2

## Recent versions

- 2.4.1 (latest) — 2025-09-12
- 2.4.0 — 2025-09-12
- 2.3.0 — 2025-04-04
- 2.2.0 — 2024-12-28
- 2.1.0 — 2024-12-15
- 2.0.1 — 2024-12-13
- 2.0.0 — 2024-12-13
- 1.6.0 — 2024-10-05
- 1.5.9 — 2024-09-10
- 1.5.8 — 2024-09-10
- 1.5.7 — 2024-09-09
- 1.5.6 — 2024-09-06
- 1.5.5 — 2024-09-02
- 1.5.4 — 2024-07-16
- 1.5.3 — 2024-06-24
- … 38 more at https://npm.io/package/mkdist/versions

## README

# mkdist

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Github Actions][github-actions-src]][github-actions-href]
[![Codecov][codecov-src]][codecov-href]

<!-- ![...](.github/banner.svg) -->

> Lightweight file-to-file transformer

✅ Copies all assets

✅ Supports [Vue Single File Components](https://vuejs.org/v2/guide/single-file-components.html)

✅ Fast and minimal transform by [esbuild](https://github.com/evanw/esbuild)

✅ `.d.ts` generation for `.ts`, `.js` and `.vue` files

✅ Support [postcss](https://postcss.org/) ([autoprefixer](https://github.com/postcss/autoprefixer), [cssnano](https://cssnano.co/) and [postcss-nested](https://www.npmjs.com/package/postcss-nested) enabled out of the box!)

## ❓ Why?

Bundling libraries isn't always the best choice:

- We lose original file structure
- We lose modern syntax by transpiling in bundle
- We lose critical-css by extracting css to a global dist (vue)
- Dependencies will be always imported from bundle even if not used (a second bundling step might fix this but it usually won't happen in development and for dependencies with side-effects)

While there are tools like [tsc](https://www.typescriptlang.org/docs/handbook/compiler-options.html) and [@babel/cli](https://babeljs.io/docs/en/babel-cli), they mostly focus on transpiling rather than keeping source level quality. Also they lack support for handling custom extensions like `.vue` and copying assets.

## 🚀 Usage

```bash
npx mkdist [rootDir] [--src=src] [--dist=dist] [--no-clean] [--pattern=glob [--pattern=more-glob]] [--format=cjs|esm] [-d|--declaration] [--ext=mjs|js|ts]
```

## License

[MIT](./LICENSE)

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/mkdist?style=flat-square
[npm-version-href]: https://npmjs.com/package/mkdist
[npm-downloads-src]: https://img.shields.io/npm/dm/mkdist?style=flat-square
[npm-downloads-href]: https://npmjs.com/package/mkdist
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/unjs/mkdist/ci.yml?branch=main&style=flat-square
[github-actions-href]: https://github.com/unjs/mkdist/actions?query=workflow%3Aci
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/mkdist/main?style=flat-square
[codecov-href]: https://codecov.io/gh/unjs/mkdist

---
_Source: https://npm.io/package/mkdist · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
