Skip to content

Commit

Permalink
refactor: enable msw in production
Browse files Browse the repository at this point in the history
  • Loading branch information
d3george committed Oct 9, 2023
1 parent 98c0d07 commit 5317675
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@ jobs:
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: dist
FOLDER: dist
CLEAN: true


7 changes: 3 additions & 4 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ const queryClient = new QueryClient({
});

// start service worker mock in development mode
if (import.meta.env.MODE === 'development') {
const { worker } = await import('./_mock');
await worker.start({ onUnhandledRequest: 'bypass' });
}
// if (import.meta.env.MODE === 'development') { //... }
const { worker } = await import('./_mock');
await worker.start({ onUnhandledRequest: 'bypass' });

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);

Expand Down

0 comments on commit 5317675

Please sign in to comment.