Closed blaenk closed 11 months ago
@kettanaito any chance you can look at this? I would appreciate it!
Thank you for working on this project!
This has been released in v0.25.12!
Make sure to always update to the latest version (npm i @mswjs/interceptors@latest
) to get the newest features and bug fixes.
Predictable release automation by @ossjs/release.
Woo didn't realize this had already been addressed, thanks for the fix!
This, in combination with configuring my
tsconfig.ts
to 'activate' thebrowser
condition when evaluating this package'sexports
field viacustomConditions
, allows typescript to automatically (well, viaexports
) pick all of the right types and compile cleanly!Here is the
customConditions
field in mytsconfig.ts
:I think having the user enable this is not onerous at all and probably ideal if they are indeed targeting the browser. Compare that to requiring the user to explicitly override paths via
paths
and then requiring the bundler to know about that (via some tsconfig-paths plugin).This way, it will ignore the root level
"types"
ifbrowser
is activated/true, in which case it instead uses the browser ones, solving the issue where otherwise the root typings file was used, so thebrowserInterceptors
would not match with theBatchInterceptor
since the one being used was the node one.I'm not sure what other effects this would have, but I don't see why it would have any, and it appears to be consistent with everything else we're doing with the
browser
condition.