Configuration Options
Complete reference for every Packem configuration option
Configuration Options
All options are set in packem.config.ts using defineConfig. This page lists every available option grouped by category. Click through to the individual pages for examples and details.
import { defineConfig } from '@visulima/packem/config'
import transformer from '@visulima/packem/transformer/esbuild'
export default defineConfig({
transformer,
// ...options below
})Input and output
| Option | Description |
|---|---|
| entry | Configure entry points and automatic detection |
| config-file | Config file setup, formats, and environment variables |
| output-directory | Control where built files are written |
| output-format | ESM, CJS, IIFE output formats |
| output-extension-map | Custom file extensions for output files |
| source-dir | Source directory for entry point resolution |
| root-dir | Project root directory |
| name | Package name override |
Build behavior
| Option | Description |
|---|---|
| target | JavaScript compilation target (ES2020, ESNext, etc.) |
| declaration-files | TypeScript .d.ts generation and isolated declarations |
| minify | Minification with terser, esbuild, or oxc |
| source-maps | Source map generation |
| externals | External dependency handling |
| alias | Module path aliases |
| barrel | Barrel file optimization |
Plugins and hooks
| Option | Description |
|---|---|
| plugins | Rollup plugin integration |
| hooks | Build lifecycle hooks |
| builder | Builder configuration |
Development
| Option | Description |
|---|---|
| watch | Watch mode and file watching |
| debug | Debug output and diagnostics |
| analyze | Bundle analysis and visualization |
| on-success | Post-build commands |
| fail-on-warn | Treat warnings as errors |
Advanced
| Option | Description |
|---|---|
| file-cache | Persistent file cache for faster rebuilds |
| jiti | Runtime TypeScript config loading |
| kill-signal | Process termination signal |
| experimental | Experimental features |
| typedoc | TypeDoc documentation generation |
| ignore-export-keys | Exclude specific export keys |
| allowed-export-extensions | Custom file extensions in exports |