import { createSSRApp } from 'vue'
import App from './App.vue'
// 引入全局组件注册方法
import registerGlobalComponents from './components/index'
import { requestInterceptor } from './http/interceptor'

import { routeInterceptor } from './router/interceptor'

import store from './store'
import '@/style/index.scss'
import 'virtual:uno.css'

export function createApp() {
  const app = createSSRApp(App)
  app.use(store)
  app.use(routeInterceptor)
  app.use(requestInterceptor)
  registerGlobalComponents(app)

  return {
    app,
  }
}
