Skip to content

feat: support a .pkgrc configuration file #238

@robertsLando

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.jsonpkg.config.jspackage.json#pkg)
  • Update lib/index.ts config resolution logic
  • Document the new config file format

Part of #235

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