提交 2884e863 作者: vben

perf: not waiting for router.isReady

上级 1235978a
......@@ -3,7 +3,6 @@
* https://github.com/anncwb/vite-plugin-compression
*/
import type { Plugin } from 'vite';
import compressPlugin from 'vite-plugin-compression';
export function configCompressPlugin(
......@@ -22,6 +21,7 @@ export function configCompressPlugin(
})
);
}
if (compressList.includes('brotli')) {
plugins.push(
compressPlugin({
......
......@@ -3,9 +3,7 @@
* https://github.com/anncwb/vite-plugin-html
*/
import type { Plugin } from 'vite';
import html from 'vite-plugin-html';
import pkg from '../../../package.json';
import { GLOB_CONFIG_FILE_NAME } from '../../constant';
......
// Image resource files used to compress the output of the production environment
// https://github.com/anncwb/vite-plugin-imagemin
import viteImagemin from 'vite-plugin-imagemin';
export function configImageminPlugin() {
......
import type { Plugin } from 'vite';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import legacy from '@vitejs/plugin-legacy';
import purgeIcons from 'vite-plugin-purge-icons';
import windiCSS from 'vite-plugin-windicss';
import { configHtmlPlugin } from './html';
......
......@@ -2,7 +2,6 @@
* Zero-config PWA for Vite
* https://github.com/antfu/vite-plugin-pwa
*/
import { VitePWA } from 'vite-plugin-pwa';
export function configPwaConfig(env: ViteEnv) {
......
......@@ -2,11 +2,12 @@
* Introduces component library styles on demand.
* https://github.com/anncwb/vite-plugin-style-import
*/
import styleImport from 'vite-plugin-style-import';
export function configStyleImportPlugin(isBuild: boolean) {
if (!isBuild) return [];
if (!isBuild) {
return [];
}
const styleImportPlugin = styleImport({
libs: [
{
......
......@@ -35,8 +35,8 @@
},
"dependencies": {
"@iconify/iconify": "^2.0.4",
"@logicflow/core": "^0.6.13",
"@logicflow/extension": "^0.6.13",
"@logicflow/core": "^0.6.15",
"@logicflow/extension": "^0.6.15",
"@vueuse/core": "^6.0.0",
"@zxcvbn-ts/core": "^1.0.0-beta.0",
"ant-design-vue": "2.2.6",
......@@ -59,15 +59,15 @@
"vditor": "^3.8.6",
"vue": "3.2.4",
"vue-i18n": "9.1.7",
"vue-json-pretty": "1.8.1",
"vue-router": "^4.0.11",
"vue-types": "^4.0.3",
"xlsx": "^0.17.1"
"xlsx": "^0.17.1",
"vue-json-pretty": "1.8.1"
},
"devDependencies": {
"@commitlint/cli": "^13.1.0",
"@commitlint/config-conventional": "^13.1.0",
"@iconify/json": "^1.1.391",
"@iconify/json": "^1.1.392",
"@purge-icons/generated": "^0.7.0",
"@types/codemirror": "^5.60.2",
"@types/crypto-js": "^4.0.2",
......@@ -82,8 +82,8 @@
"@types/qrcode": "^1.4.1",
"@types/qs": "^6.9.7",
"@types/sortablejs": "^1.10.7",
"@typescript-eslint/eslint-plugin": "^4.29.2",
"@typescript-eslint/parser": "^4.29.2",
"@typescript-eslint/eslint-plugin": "^4.29.3",
"@typescript-eslint/parser": "^4.29.3",
"@vitejs/plugin-legacy": "^1.5.1",
"@vitejs/plugin-vue": "^1.4.0",
"@vitejs/plugin-vue-jsx": "^1.1.7",
......@@ -132,15 +132,14 @@
"vite-plugin-style-import": "^1.2.1",
"vite-plugin-svg-icons": "^1.0.4",
"vite-plugin-theme": "^0.8.1",
"vite-plugin-windicss": "^1.2.7",
"vite-plugin-windicss": "^1.2.8",
"vue-eslint-parser": "^7.10.0",
"vue-tsc": "^0.3.0"
},
"resolutions": {
"//": "Used to install imagemin dependencies, because imagemin may not be installed in China. If it is abroad, you can delete it",
"bin-wrapper": "npm:bin-wrapper-china",
"rollup": "^2.56.2",
"vue-json-pretty": "1.8.1"
"rollup": "^2.56.3"
},
"repository": {
"type": "git",
......
import '/@/design/index.less';
// Register windi
// import 'virtual:windi.css';
import 'virtual:windi-base.css';
import 'virtual:windi-components.css';
import 'virtual:windi-utilities.css';
......@@ -19,10 +16,9 @@ import { setupGlobDirectives } from '/@/directives';
import { setupI18n } from '/@/locales/setupI18n';
import { registerGlobComp } from '/@/components/registerGlobComp';
// Do not introduce on-demand in local development?
// In the local development for introduce on-demand, the number of browser requests will increase by about 20%.
// Which may slow down the browser refresh.
// Therefore, all are introduced in local development, and only introduced on demand in the production environment
// Importing on demand in local development will increase the number of browser requests by around 20%.
// This may slow down the browser refresh speed.
// Therefore, only enable on-demand importing in production environments .
if (import.meta.env.DEV) {
import('ant-design-vue/dist/antd.less');
}
......@@ -40,6 +36,7 @@ async function bootstrap() {
registerGlobComp(app);
// Multilingual configuration
// Asynchronous case: language files may be obtained from the server side
await setupI18n(app);
// Configure routing
......@@ -54,9 +51,8 @@ async function bootstrap() {
// Configure global error handling
setupErrorHandle(app);
// Mount when the route is ready
// https://next.router.vuejs.org/api/#isready
await router.isReady();
// await router.isReady();
app.mount('#app', true);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论