diff options
Diffstat (limited to 'src/main.ts')
-rw-r--r-- | src/main.ts | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/main.ts b/src/main.ts index f063ef6..12bda00 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,25 +1,30 @@ -import { createApp } from 'vue'; import { createPinia } from 'pinia'; -import { createHead } from '@vueuse/head'; // eslint-disable-next-line import/no-unresolved -import { registerSW } from 'virtual:pwa-register'; +import { ViteSSG } from 'vite-ssg'; import { plausible } from './plugins/plausible.plugin'; import 'virtual:uno.css'; -registerSW(); - -import { naive } from './plugins/naive.plugin'; +// import { naive } from './plugins/naive.plugin'; import App from './App.vue'; -import router from './router'; - -const app = createApp(App); +import { routes } from './router'; +import { config } from './config'; +// import { useToolStore } from './tools/tools.store'; -app.use(createPinia()); -app.use(createHead()); -app.use(router); -app.use(naive); -app.use(plausible); +export const createApp = ViteSSG( + // the root component + App, + // vue-router options + { routes, base: config.app.baseUrl }, + // function to have custom setups + async ({ app, router, routes, isClient, initialState }) => { + // install plugins etc. + const pinia = createPinia(); + app.use(pinia); -app.mount('#app'); + app.use(plausible); + // import { registerSW } from 'virtual:pwa-register'; + // registerSW(); + }, +); |