Skip to content

feat: support a .pkgrc configuration file #238

Closed

Description

@robertsLando

Currently, pkg reads configuration from the "pkg" field in package.json or a custom JSON file passed via --config. This requires either polluting package.json with pkg-specific fields or maintaining a separate .config.json file that must be explicitly referenced on every invocation.

Proposal

Support a .pkgrc (or .pkgrc.json / pkg.config.js) file that is auto-discovered in the project root, similar to how tools like ESLint, Prettier, and Babel handle configuration. This would:

  • Reduce CLI verbosity — no need to pass --config every time
  • Keep package.json clean
  • Allow comments and richer config formats (JS/YAML) if desired

Scope

  • Define the lookup order (e.g. .pkgrc → .pkgrc.json → pkg.config.js → package.json#pkg)
  • Update lib/index.ts config resolution logic
  • Document the new config file format

Part of #235

Activity

  1. added a commit that references this issue on Apr 20, 2026
    e4b62dd
  2. added a commit that references this issue on Apr 20, 2026
    53ce68b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions