Skip to content

Conversation

@hv068
Copy link
Contributor

@hv068 hv068 commented Jul 23, 2025

What was wrong:

  • Missing exports field - Modern Node.js and bundlers couldn't properly resolve the package
  • No type field - Caused ambiguity about whether this is an ESM or CJS package
  • tsup in main dependencies - Build tool was being installed in production
  • Inconsistent file extensions - Mixed .mjs and .js naming

What was fixed:

  • Added exports field for proper module resolution
  • Set "type": "module" to clarify this is an ESM package
  • Moved tsup to devDependencies
  • Standardized output to .js (ESM) and .cjs (CommonJS)

Result:
Package now properly supports both import and require() with modern best practices and without issues cause earlier (constructor in types not detected, forcing client to use CommonJS)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants