C

msw/2/imports

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

Following the original msw upgrade guide, there are certain imports that changed their location and/or naming. This codemod will adjust your imports to the new location and naming.

  • setupWorker is now imported from msw/browser
  • rest from msw is now named http
  • RestHandler from msw is now named HttpHandler

Before

ts

After

ts

Ready to contribute?

Build your own codemod and share it with the community.