Skip to content

Commit

Permalink
修正 sw.js
Browse files Browse the repository at this point in the history
  • Loading branch information
2234839 committed Jan 3, 2024
1 parent 82380d0 commit 636fb44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/frontend/src/pages/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const preview = defineComponent({
const iframeHref = ref<string | null>(null)
// firefox 不兼容
navigator.serviceWorker
.register(import.meta.env.PROD ? 'sw.js' : '/sw.ts', {
.register(import.meta.env.PROD ? 'sw.iife.js' : '/sw.ts', {
scope: '/',
})
.then(async (_r) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/vite.sw.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default defineConfig({
entry: ['./sw.ts'],
name: 'sw',
fileName: 'sw',
formats: ['es'],
formats: ['iife'],
},
},
resolve: {
Expand Down

0 comments on commit 636fb44

Please sign in to comment.