2024-05-24 23:11:03 +08:00
|
|
|
import { setupPreference } from '@vben/preference';
|
2024-05-19 21:20:42 +08:00
|
|
|
|
|
|
|
import { overridesPreference } from './preference';
|
|
|
|
|
2024-05-24 23:11:03 +08:00
|
|
|
/**
|
|
|
|
* 应用初始化完成之后再进行页面加载渲染
|
|
|
|
*/
|
|
|
|
async function initApplication() {
|
|
|
|
const env = import.meta.env.PROD ? 'prod' : 'dev';
|
2024-05-25 22:43:22 +08:00
|
|
|
const namespace = `${import.meta.env.VITE_APP_NAMESPACE}-${env}`;
|
2024-05-24 23:11:03 +08:00
|
|
|
|
|
|
|
// app偏好设置初始化
|
2024-05-19 21:20:42 +08:00
|
|
|
await setupPreference({
|
2024-05-24 23:11:03 +08:00
|
|
|
namespace,
|
2024-05-19 21:20:42 +08:00
|
|
|
overrides: overridesPreference,
|
|
|
|
});
|
|
|
|
|
2024-05-25 22:43:22 +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();
|