package-exports

Configure package.json exports and module resolution in monorepos.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/orient-bot/orient --skill package-exports
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: package-exports
Source: https://github.com/orient-bot/orient/tree/main/.claude/skills/package-exports
Command: npx skills add https://github.com/orient-bot/orient --skill package-exports

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you understand and configure how packages are imported and resolved within the Orient monorepo, preventing module resolution errors and ensuring correct import paths.

Core Features & Use Cases

  • Import Resolution: Clarifies the difference between importing from source (src/) versus distribution (dist/) directories.
  • package.json Exports: Explains how to define entry points using the exports field for both basic and subpath exports.
  • Development vs. Production: Details how TypeScript path aliases are used during development and how package exports are used in production.
  • Re-exporting: Provides strategies for creating barrel files and re-exporting modules from dependencies.
  • Use Case: You're encountering "Cannot find module" errors when importing a package within the monorepo. This Skill guides you through checking your package.json exports, ensuring the package is built, and verifying your import statements.

Quick Start

Use the package-exports skill to understand why importing '@orientbot/core' fails at runtime after a build.

Frequently Asked Questions about package-exports

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does importing a package from a monorepo fail with a module resolution error after building?

Monorepo module resolution errors after a build often occur because package.json exports are misconfigured or the package is not built to the dist directory. Verifying import statements against your exports field resolves this.

How do I configure package.json exports for subpath imports in a TypeScript monorepo?

Configuring package.json exports involves defining entry points for basic and subpath imports. This ensures modules within your monorepo are correctly resolved whether importing from source or distribution directories.

What is the difference between importing from source versus dist directories in a monorepo?

Importing from source uses TypeScript path aliases during development, while production relies on package.json exports to resolve modules from the dist directory after the build process has completed.

How do I set up re-exporting strategies and barrel files for monorepo packages?

Setting up re-exporting involves creating barrel files that aggregate and re-export modules from dependencies. This strategy streamlines import paths and prevents module resolution errors across your packages.

When do I need TypeScript path aliases versus package exports for module resolution?

TypeScript path aliases are needed during development to import directly from source, while package exports are required for production-time resolution logic to correctly fetch modules from the dist directory.