From e81ad7816aaaa7ed49d067683a403070b02eb1f3 Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Wed, 4 Dec 2024 17:07:37 +0800 Subject: [PATCH] use relative path for service worker url --- .../.storybook-templates/preview.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/scripts-config-storybook-lib/.storybook-templates/preview.js b/tools/scripts-config-storybook-lib/.storybook-templates/preview.js index 4127713246..28c667070b 100644 --- a/tools/scripts-config-storybook-lib/.storybook-templates/preview.js +++ b/tools/scripts-config-storybook-lib/.storybook-templates/preview.js @@ -10,7 +10,12 @@ import { initI18n } from './i18n'; const { i18n: userI18n, cmf, ...userPreview } = <% if(userFilePath) { %> require(String.raw`<%= userFilePath %>`); <% } else { %> {}; <% } %> // msw -initialize({ onUnhandledRequest: 'bypass' }); +initialize({ + onUnhandledRequest: 'bypass', + serviceWorker: { + url: './mockServiceWorker.js' + } +}); // i18next const i18n = initI18n(userI18n);