Skip to content

feat: add Dual Module Package support with ESM entry point#237

Open
kings9527 wants to merge 1 commit into
webpack:mainfrom
kings9527:main
Open

feat: add Dual Module Package support with ESM entry point#237
kings9527 wants to merge 1 commit into
webpack:mainfrom
kings9527:main

Conversation

@kings9527
Copy link
Copy Markdown

Summary

This PR adds Dual Module Package support to tapable, enabling both CommonJS and ESM consumers to import the library natively.

Changes

  • **Added ** — ESM entry point that re-exports all Hook classes from the existing CJS modules.
  • **Updated ** — Added conditional field:
    • → (CommonJS)
    • → (ESM)
  • **Added ** — Verifies both CJS and ESM entry points work correctly and all 12 Hook classes are accessible.

Verification

42

Closes #185

- Add lib/index.mjs as ESM entry point exporting all Hook classes
- Add exports field in package.json for conditional CJS/ESM exports
- Add DualPackage.test.js to verify both entry points work correctly

Closes webpack#185
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 23, 2026

⚠️ No Changeset found

Latest commit: 3b9003a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@linux-foundation-easycla
Copy link
Copy Markdown

CLA Missing ID

  • ❌ The email address for the commit (3b9003a) is not linked to the GitHub account, preventing the EasyCLA check. Consult this Help Article and GitHub Help to resolve. (To view the commit's email address, add .patch at the end of this PR page's URL.) For further assistance with EasyCLA, please visit our EasyCLA portal and chat with our support bot.

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.

Ship it with Dual Module Package

1 participant