perf: optimize local loading speed close #329

This commit is contained in:
Vben
2021-03-07 20:21:31 +08:00
parent 551fe50a44
commit 491f1fcfff
7 changed files with 97 additions and 59 deletions

View File

@@ -1,6 +1,14 @@
import '/@/design/index.less';
import 'windi.css';
// Do not introduce on-demand in local development?
// In the local development for on-demand introduction, the number of browser requests will increase by about 20%.
// Which may slow down the browser refresh.
// Therefore, all local development is introduced, and the production environment is introduced on demand
if (import.meta.env.DEV) {
import('ant-design-vue/dist/antd.less');
}
import { createApp } from 'vue';
import App from './App.vue';
@@ -12,6 +20,7 @@ import { setupI18n } from '/@/locales/setupI18n';
import { registerGlobComp } from '/@/components/registerGlobComp';
// Register icon Sprite
import 'vite-plugin-svg-icons/register';
import { isDevMode } from '/@/utils/env';