34 lines
1.0 KiB
TypeScript
Raw Normal View History

2025-03-11 10:29:43 +08:00
import { initPreferences } from '@vben/preferences';
import { unmountGlobalLoading } from '@vben/utils';
// eslint-disable-next-line unused-imports/no-unused-imports
import client from '#/api-client-config/index';
2025-05-27 13:54:28 +08:00
import { overridesPreferences } from './preferences';
2025-03-11 10:29:43 +08:00
/**
*
*/
async function initApplication() {
// name用于指定项目唯一标识
// 用于区分不同项目的偏好设置以及存储数据的key前缀以及其他一些需要隔离的数据
const env = import.meta.env.PROD ? 'prod' : 'dev';
const appVersion = import.meta.env.VITE_APP_VERSION;
const namespace = `${import.meta.env.VITE_APP_NAMESPACE}-${appVersion}-${env}`;
// app偏好设置初始化
await initPreferences({
namespace,
overrides: overridesPreferences,
});
// 启动应用并挂载
// vue应用主要逻辑及视图
const { bootstrap } = await import('./bootstrap');
await bootstrap(namespace);
// 移除并销毁loading
unmountGlobalLoading();
}
initApplication();