Skip to content

Commit

Permalink
Merge pull request #176 from GDSC-PKNU-21-22/dev
Browse files Browse the repository at this point in the history
부리미 v0.27 배포
  • Loading branch information
pp449 authored Aug 23, 2023
2 parents 9abe537 + ee14756 commit a88a978
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,5 @@
"vite-plugin-pwa": "^0.16.4",
"vite-tsconfig-paths": "^4.0.7"
},
"types": "module",
"msw": {
"workerDirectory": "public"
}
"types": "module"
}
2 changes: 1 addition & 1 deletion public/mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* - Please do NOT serve this file on production.
*/

importScripts('./serviceWorker.js');
importScripts('./sw.js');

const INTEGRITY_CHECKSUM = '3d6b9f06410d179a7f7404d4bf4c3c70';
const activeClientIds = new Set();
Expand Down
3 changes: 0 additions & 3 deletions public/serviceWorker.js

This file was deleted.

8 changes: 8 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ import { worker } from 'src/mocks/browser';

import App from './App';

if ('serviceWorker' in navigator) {
if (process.env.NODE_ENV === 'development') {
navigator.serviceWorker.register('/mockServiceWorker.js');
} else {
navigator.serviceWorker.register('/sw.js');
}
}

if (process.env.NODE_ENV === 'development') {
worker.start();
}
Expand Down

0 comments on commit a88a978

Please sign in to comment.