Skip to content
Projects

Kikobeats/untracked has 831 GitHub stars and 17 forks. GitHot measured -1 stars in 24 hours and -1 in 7 days. Last checked 2026-11-21 13:05 UTC. Last push 2026-11-17.

How these counts are measured

Measured star growth

in 24h
-1
in 7 days
-1
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

About

Ignore common junk files in zip/lambda/webpack bundles with a universal untracked file list.

Web & Apps

README.md

Original

untracked



Last version NPM Status

Universal way for ignoring unnecessary common files to create the smallest production bundle possible.

untracked generates ignore patterns for files you don't need in production: documentation, config files, source maps, type definitions, test files, and more: using gitignore pattern format, making it compatible with any tool that supports ignore files.

Install

npm install untracked -g

Usage

npx untracked

The files to ignore will be detected automagically.

Write to a file

Redirect the output to any ignore file:

npx untracked > .dockerignore
npx untracked > .slugignore
npx untracked > .vercelignore

Update in place

If you already have an ignore file with custom rules, use --write to update only the auto-generated section (between ### start and ### finished markers) while preserving everything else:

npx untracked --write .dockerignore

Platform examples

Heroku: write as .slugignore during prebuild:

{
  "scripts": {
    "heroku-prebuild": "npx untracked > .slugignore"
  }
}

Vercel: write as .vercelignore:

npx untracked > .vercelignore

Docker: write as .dockerignore:

npx untracked > .dockerignore

Yarn: clean up node_modules via .yarnclean:

yarn install --production
npx untracked > .yarnclean
yarn autoclean --force

Prune an installed node_modules

Ignore files only filter what gets copied. When dependencies are installed inside the image or bundle (RUN npm ci in a Dockerfile), run prune after the install instead:

npx untracked prune            # defaults to ./node_modules
npx untracked prune --dry-run  # list what would go, delete nothing

It deletes files no production code reads: source maps (*.map), type definitions (*.d.ts, *.d.mts, *.d.cts), Flow sources (*.flow), and readmes, changelogs, histories, authors, contributors and code of conduct files in any markup format. It matches file names only, so directories, dotfiles and licenses are never deleted, and it never follows symlinks, so it is safe on pnpm's .pnpm layout.

typescript/lib is always kept, because the TypeScript compiler reads its .d.ts files at runtime. Keep any other directory or file with --keep, repeated as needed. A relative path matches wherever it appears in the tree, so my-pkg/types also covers pnpm's .pnpm/[email protected]/node_modules/my-pkg/types; an absolute path matches only itself:

npx untracked prune node_modules --keep my-pkg/types --keep other-pkg/index.d.ts

Unknown flags are rejected before anything is deleted. A file or directory it cannot read or delete is reported on stderr, the rest of the tree is still pruned, and the command exits with 1.

In a Dockerfile, prune in the same RUN as the install. A later layer only hides the files, so the image still ships them. pnpm hardlinks files from its store, so remove the store in that RUN too, or the space is not freed:

RUN pnpm install --prod && rm -rf "$(pnpm store path)" && npx untracked prune

On microlink-api's production dependencies it removes 17,489 files (110.9 MB) in about a second, and every dependency still loads.

Configuration

Customize ignored files by declaring an untracked field in your package.json:

{
  "untracked": {
    "whitelist": ["bin"],
    "blacklist": ["node_modules/puppeteer/.local-chromium"]
  }
}
Field Description
whitelist Files to include in the bundle (won't be ignored)
blacklist Additional files to ignore
write Set to true (defaults to .dockerignore) or a file path to auto-update in place

You can also use any cosmiconfig supported format: .untrackedrc, .untrackedrc.json, .untrackedrc.js, or untracked.config.js.

How it works

untracked builds a comprehensive list of common files to ignore, covering:

  • Documentation: README, LICENSE, CHANGELOG, CONTRIBUTING, etc. (all markup formats)
  • Tooling: Makefile, Gruntfile, Gulpfile, karma.conf.js, jest.config.js, etc.
  • Assets: *.map, *.d.ts, *.flow, etc.
  • Artifacts: coverage/, docs/, examples/, test*, etc.

It then reads your dependencies from npm ls --prod and generates ignore rules that exclude everything unnecessary while preserving your production dependencies.

Related

License

untracked © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.

kikobeats.com · GitHub @Kiko Beats · X @Kikobeats

Explore related projects

Loading…