1. mkdist
Lightweight file-to-file transformer
mkdist
Package: mkdist
Created by: unjs
Last modified: Thu, 25 Apr 2024 16:02:04 GMT
Version: 1.5.1
License: MIT
Downloads: 335,393
Repository: https://github.com/unjs/mkdist

Install

npm install mkdist
yarn add mkdist

mkdist

npm version
npm downloads
Github Actions
Codecov

Lightweight file-to-file transformer

✅ Copies all assets

✅ Supports Vue Single File Components

✅ Fast and minimal transform by esbuild

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

✅ Support postcss (autoprefixer, cssnano and 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 and @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

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

License

MIT

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code