| 1 |
import { createApp } from 'vue' |
| 2 |
import { createPinia } from 'pinia' |
| 3 |
import router from './router' |
| 4 |
import App from './App.vue' |
| 5 |
|
| 6 |
// Global styles |
| 7 |
import './assets/styles/main.css' |
| 8 |
|
| 9 |
// PWA registration |
| 10 |
import { registerSW } from 'virtual:pwa-register' |
| 11 |
|
| 12 |
const app = createApp(App) |
| 13 |
|
| 14 |
app.use(createPinia()) |
| 15 |
app.use(router) |
| 16 |
|
| 17 |
app.mount('#app') |
| 18 |
|
| 19 |
// Register service worker for PWA |
| 20 |
const updateSW = registerSW({ |
| 21 |
onNeedRefresh() { |
| 22 |
if (confirm('New content available. Reload?')) { |
| 23 |
updateSW(true) |
| 24 |
} |
| 25 |
}, |
| 26 |
onOfflineReady() { |
| 27 |
console.log('App ready to work offline') |
| 28 |
}, |
| 29 |
}) |