Support CommonJS in the JS package#326
Conversation
|
Thanks for the PR, CommonJS support is something we want. I built and tested the branch locally and hit two blockers that need fixing before merge. 1. The CJS output doesn't load on the Node range we support. With Because the package is This affects all three new Setting 2. The tsup DTS pass fails:
Could you flip to |
|
@Cloak-HQ Thanks for the detailed review. I switched tsup to bundle: true and fixed the DTS config to resolve Node types and ignore the TS 6.0 deprecation warning. npm run build and npm test are both green locally now. |
Summary
This PR adds CommonJS support for the
jspackage while keeping the existing ESM exports.Changes
tsuprequireentries toexportsfor:cloakbrowsercloakbrowser/puppeteercloakbrowser/humanmainto the CommonJS entrypointmodulepointing to the ESM entrypointWhy
The package already exposed ESM entrypoints, but it did not provide official CommonJS entrypoints through
exports.This change allows usage like: