mswjs / msw

Seamless REST/GraphQL API mocking library for browser and Node.js.
https://mswjs.io
MIT License
15.28k stars 479 forks source link

chore: update vitest configuration to ESM #2189

Closed KaiSpencer closed 1 day ago

KaiSpencer commented 1 week ago

Vitest (and Vite) Commonjs build is deprecated and will be removed in a future version. There is a console warning when running tests indicating to update to use Vites ESM build.

Relevant docs from Vite: https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated

Screenshot 2024-06-24 at 13 38 48

This PR updates the vitest config files to use an .mts extension and therefore use the Vite ESM build.