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
We can utilize the exports field of package.json to automatically expose the correct exports based on the environment where msw is being imported in. This would allow us to drop import path like msw/node and msw/native, making the library more predictable across environments.
This is a very basic example as each export would also have to point to its own "types" so the "browser" and "node" fields must be expanded with the "type" key as well as the export type key.
It also makes sense to ship this change with backward-compatibility so people on old bundlers could still use MSW as before: via msw/node and msw/native direct imports. We may consider dropping those imports after some time.
The text was updated successfully, but these errors were encountered:
Scope
Adds a new behavior
Compatibility
Feature description
We can utilize the
exports
field of package.json to automatically expose the correct exports based on the environment wheremsw
is being imported in. This would allow us to drop import path likemsw/node
andmsw/native
, making the library more predictable across environments.It also makes sense to ship this change with backward-compatibility so people on old bundlers could still use MSW as before: via
msw/node
andmsw/native
direct imports. We may consider dropping those imports after some time.The text was updated successfully, but these errors were encountered: