Storybook on serverless/aws

Hey rw experts,

I’m trying to get both our redwood Web as well as the corresponding Storybook deployed in our cicd pipeline. Before the yarn rw deploy serverless --stage test we’re running yarn rw sb --build to bring storybook statically into the public directory (having the correct API_URL in the run step env).

This does also add the necessary mockServiceWorker.js. However, this isn’t packaged or deployed. It appears that the webpack config seems to explicitly exclude it in non-production builds (at least that’s the the only reference I could find and a reasonable explanation for it not being there):


It seems when it’s not there SB complains about insecure content because it’ll get the error doc as text/text referencing mockServiceWorker.js and - as soon as I manually add the file back to the S3 bucket Storybook indeed works fine.

so I’m curious if I’m missing something here, it looks like there was a reason to specific exclude it…? any ideas to work around it (other than running Storybook in a separate container instead of serverless)?

thx. O