admin-vben5/apps/antd-view/src/main.ts

24 lines
711 B
TypeScript
Raw Normal View History

2024-06-01 23:15:29 +08:00
import { preferencesManager } from '@vben-core/preferences';
2024-05-19 21:20:42 +08:00
2024-06-01 23:15:29 +08:00
import { overridesPreferences } from './preferences';
2024-05-19 21:20:42 +08:00
2024-05-24 23:11:03 +08:00
/**
*
*/
async function initApplication() {
2024-06-01 23:15:29 +08:00
// name用于指定项目唯一标识
// 用于区分不同项目的偏好设置以及存储数据的key前缀以及其他一些需要隔离的数据
2024-05-24 23:11:03 +08:00
const env = import.meta.env.PROD ? 'prod' : 'dev';
const namespace = `${import.meta.env.VITE_APP_NAMESPACE}-${env}`;
2024-05-24 23:11:03 +08:00
// app偏好设置初始化
2024-06-01 23:15:29 +08:00
await preferencesManager.initPreferences({
2024-05-24 23:11:03 +08:00
namespace,
2024-06-01 23:15:29 +08:00
overrides: overridesPreferences,
2024-05-19 21:20:42 +08:00
});
import('./bootstrap').then((m) => m.bootstrap(namespace));
2024-05-19 21:20:42 +08:00
}
2024-05-24 23:11:03 +08:00
initApplication();