Skip to content

v5.1.2

  • v5.1.2
  • 3b72280
  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
  • Choose a tag to compare

  • v5.1.2
  • 3b72280
  • Choose a tag to compare

  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@achingbrain achingbrain tagged this 24 Nov 07:29
When we stub files for environments that do not handle export maps very well, we `require` a transpiled CJS implementation and re-export it in a stub file that should be immediately overridden by the `browser` or `exports` fields in `package.json`.

At the moment we use the value from the `browser` overrides to work out which file we should `require` the stub. The change here is to `require` the transpiled regular CJS version in the stub instead of the browser override.

Turns out when Jest has `testEnvironment: 'node'` set it resolves `require`s to the stubs, ignoring `exports` which loads browser-specific code into node with predictably incendiary results.
Assets 2
Loading