Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: bundling compatibility with webpack@5 (#2519)
* fix: bundling compatibility with webpack@5 when using webpack v5 to bundle code that calls `require('sinon')` (cjs) , it would have defaulted to "exports->require" and fail with multiple node-api requirements (util, timers, etc.) this patch ensures that anyone who bundles sinon for browser gets the (browser-compatible) esm version. tested on both webpack v5 and v4. should be noted that v4 worked even without this patch, as it automatically injected polyfills. v5 no longer does so. with this PR, people using webpack@4 to bundle sinon at least see size improvement, as the polyfills are no longer required. * fix: revert change for package.json -> "browser" browserify doesn't seem to like esm. leave that entry point alone, and ensure "exports" -> "browser" (which webpack@5 uses) is esm.
- Loading branch information