You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: bundling compatibility with webpack@5 (#2519) (Avi Vahl)
24
+
> - fix: bundling compatibility with webpack@5
25
+
>
26
+
> 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.)
27
+
>
28
+
> this patch ensures that anyone who bundles sinon for browser gets the (browser-compatible) esm version.
29
+
>
30
+
> 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.
31
+
>
32
+
> - fix: revert change for package.json -> "browser"
33
+
>
34
+
> browserify doesn't seem to like esm. leave that entry point alone, and ensure "exports" -> "browser" (which webpack@5 uses) is esm.
35
+
36
+
_Released by [Carl-Erik Kopseng](https://github.com/fatso83) on 2023-06-20._
fix: bundling compatibility with webpack@5 (#2519) (Avi Vahl)
30
+
> - fix: bundling compatibility with webpack@5
31
+
>
32
+
> 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.)
33
+
>
34
+
> this patch ensures that anyone who bundles sinon for browser gets the (browser-compatible) esm version.
35
+
>
36
+
> 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.
37
+
>
38
+
> - fix: revert change for package.json -> "browser"
39
+
>
40
+
> browserify doesn't seem to like esm. leave that entry point alone, and ensure "exports" -> "browser" (which webpack@5 uses) is esm.
41
+
42
+
_Released by [Carl-Erik Kopseng](https://github.com/fatso83) on 2023-06-20._
0 commit comments