Replies: 2 comments 1 reply
-
Hey, @ben-hamel. Thanks for raising this.
MSW comes with a The
I think you should. I lean towards the philosophy that you own that worker script since it lives in your |
Beta Was this translation helpful? Give feedback.
-
okay, Thanks for clarifying this! So I must be having an issue with MSW not running the post-install script. I'll test a bit more and log an issue if needed. |
Beta Was this translation helpful? Give feedback.
-
Feedback
I have msw.workerDirectory saved in my package json, I was looking at this issue - mswjs/msw#1015 and it sounds like it should auto-install
mockServiceWorker.js
when I runnpm install
. I can't get this to work, the only way to generate again is runningnpx msw init ./public
.As for the documentation,
whenever you install the msw package,
isn't super clear. Do you mean install completely againnpm install msw --save-dev
or something else. Nothing seems to work other thannpx msw init ./public
.I would expect more of something like a code example or something to make it more clear. I'm trying to wrap my head around if I should store
mockServiceWorker.js
in git or not and it's a lot of work to get this figured out, would like a better explanation of howmsw.workerDirectory
works, what I need to do to trigger it and if I should commitmockServiceWorker.js
or not.Thanks for your time,
Beta Was this translation helpful? Give feedback.
All reactions