Closed 43081j closed 4 years ago
For Sinon we solved this by generating a separate esm module in the build.js
script:
https://github.com/sinonjs/sinon/blob/d2b4b726529f167d908747d2173b5491794ac718/build.js#L61-L80
The module
field in package.json
points to this module. We'd need to the same for fake-timers
to fix this.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
When used as an es module via the "module" property and a bundler, we get no exports.
The sources, and the commonjs output are individual exports, such as:
However, the browserify output results in an empty export:
the problem here seems to be that
"module"
in package.json should point at an ES module, but clearly doesn't. it instead points at a browserify bundle.. which is rather dated and will not work as expected in bundlers which interpret the"module"
field.