我尝试使用 msw 进行本地开发并使用官方指南进行测试
但面临以下问题:
[MSW] Failed to register a Service Worker for scope ('http://localhost:8080/') with script ('http://localhost:8080/mockServiceWorker.js'): Service Worker script does not exist at the given path.
Did you forget to run "npx msw init <PUBLIC_DIR>"?
Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/init
[1]: https://mswjs.io/docs/getting-started/integrate/browser
Run Code Online (Sandbox Code Playgroud)
我的文件夹结构: