import App from './App.vue';
import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import { setupVab } from '@/vab';
import { setupStore } from '@/store';
import { setupRouter } from '@/router';
import '@/vab/styles/tianditu.scss';
import locale from 'element-plus/lib/locale/lang/en';
import CKEditor from '@ckeditor/ckeditor5-vue';

const app = createApp(App);
import i18n from './i18n';

app.use(i18n);
app.use(ElementPlus, { locale });
app.use(CKEditor);
/**
 * @description 正式环境默认使用mock，正式项目记得注释后再打包
 */
// if (process.env.NODE_ENV === 'production') {
//   const { mockXHR } = require('@/utils/static')
//   mockXHR()
// }
/**
 * @description 生产环境启用组件初始化，编译，渲染和补丁性能跟踪。仅在开发模式和支持 Performance.mark API的浏览器中工作。
 */
if (process.env.NODE_ENV === 'development') {
  app.config.performance = true;
}

setupVab(app);
setupStore(app);
setupRouter(app);
app.mount('#vue-admin-beautiful-element-plus');
