import {
	createSSRApp
} from "vue";
import * as Pinia from 'pinia';
import { createUnistorage } from 'pinia-plugin-unistorage'
import App from "./App.vue";
import globalComponents from '@/components'
export function createApp() {
    const app = createSSRApp(App);
    const store = Pinia.createPinia();
    app.config.globalProperties.$onLaunched = new Promise(resolve => {
        app.config.globalProperties.$isResolve = resolve
      })
    store.use(createUnistorage());
    app.use(store);
    app.use(globalComponents)
    return {
        app,
        Pinia
    };
}