Cleaning

Clean output directory before build

Cleaning

The clean option controls whether Packem empties the output directory before each build, so that stale artifacts from previous builds are not left behind.

import { defineConfig } from '@visulima/packem/config'

export default defineConfig({
  clean: true,
})

Default

clean defaults to true — the output directory is cleaned before every build.

Disabling cleaning

Set clean: false to keep existing files in the output directory:

export default defineConfig({
  clean: false,
})

CLI flag

There is a --no-clean flag on packem build that disables cleaning for a single build without editing the config file:

packem build --no-clean

The flag is described as "Do not clean the dist directory before building". There is no separate --clean flag — cleaning is on by default, and --no-clean opts out.

The directory that gets cleaned is the resolved output directory (the outDir option, which defaults to your tsconfig outDir or dist).


Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues