import { createSSRApp } from 'vue'
import App from './App.vue'
import store from './store'
import { requestInterceptor, prototypeInterceptor, routerBeforeEachConfig } from './interceptors'
import 'virtual:uno.css'
import '@/style/index.scss'

export function createApp() {
  const app = createSSRApp(App)

  app.use(store)
  // app.use(routeInterceptor)
  app.use(requestInterceptor)
  app.use(prototypeInterceptor)

  setTimeout(() => {
    routerBeforeEachConfig((app as any).router)
  }, 0)

  return {
    app,
  }
}
