Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up typing and make it compatible with both CJS and ESM #141

Closed
wants to merge 1 commit into from

Conversation

jpwilliams
Copy link
Owner

@jpwilliams jpwilliams commented Nov 27, 2024

Update tsconfig.json, package.json, and jest.config.js for ESM compatibility.

  • tsconfig.json

    • Add "module": "ESNext" to compilerOptions.
    • Add "moduleResolution": "node" to compilerOptions.
  • package.json

    • Add "exports": { ".": { "import": "./lib/index.mjs", "require": "./lib/index.js" } }.
    • Add "type": "module".
  • jest.config.js

    • Add "transform": { "^.+\\.tsx?$": ["ts-jest", { "useESM": true }] }.

For more details, open the Copilot Workspace session.

Update `tsconfig.json`, `package.json`, and `jest.config.js` for ESM compatibility.

* **`tsconfig.json`**
  - Add `"module": "ESNext"` to `compilerOptions`.
  - Add `"moduleResolution": "node"` to `compilerOptions`.

* **`package.json`**
  - Add `"exports": { ".": { "import": "./lib/index.mjs", "require": "./lib/index.js" } }`.
  - Add `"type": "module"`.

* **`jest.config.js`**
  - Add `"transform": { "^.+\\.tsx?$": ["ts-jest", { "useESM": true }] }`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/jpwilliams/waitgroup?shareId=XXXX-XXXX-XXXX-XXXX).
@jpwilliams jpwilliams closed this Nov 27, 2024
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.

1 participant