refactor!: 移除 vite-plugin-html 插件

This commit is contained in:
hooray 2023-02-22 19:22:21 +08:00
parent 9feab1ebdb
commit b3a590d92d
10 changed files with 219 additions and 323 deletions

View File

@ -3,10 +3,10 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="stylesheet" href="/loading.css" />
<link rel="stylesheet" href="/browser_upgrade/index.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= title %></title>
<%- copyrightScript %>
<title>载入中…</title>
</head>
<body>
<div id="app">
@ -17,7 +17,7 @@
<div class="square"></div>
<div class="square"></div>
</div>
<div class="text"><%= title %>载入中</div>
<div class="text">载入中</div>
</div>
<div id="browser-upgrade">
<div class="title">为了您的体验,推荐使用以下浏览器</div>
@ -33,8 +33,11 @@
</div>
</div>
</div>
<%- loadingScript %>
<script>
if (!!window.ActiveXObject || 'ActiveXObject' in window) {
document.getElementById('browser-upgrade').style.display = 'block'
}
</script>
<script type="module" src="/src/main.ts"></script>
<%- devtoolScript %>
</body>
</html>

View File

@ -24,6 +24,7 @@
"axios": "^1.3.3",
"dayjs": "^1.11.7",
"element-plus": "^2.2.32",
"eruda": "^2.11.2",
"hotkeys-js": "^3.10.1",
"lodash-es": "^4.17.21",
"mitt": "^3.0.0",
@ -34,6 +35,7 @@
"pinia": "^2.0.30",
"qs": "^6.11.0",
"tinymce": "^6.3.1",
"vconsole": "^3.15.0",
"vue": "^3.2.47",
"vue-router": "^4.1.6"
},
@ -65,13 +67,13 @@
"stylelint-config-standard-vue": "^1.0.0",
"stylelint-scss": "^4.4.0",
"svgo": "^3.0.2",
"terser": "^5.16.4",
"typescript": "^4.9.5",
"unplugin-auto-import": "^0.14.3",
"unplugin-vue-components": "^0.24.0",
"vite": "^4.1.2",
"vite-plugin-banner": "^0.7.0",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-html": "^3.2.0",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-pages": "^0.28.0",
"vite-plugin-spritesmith": "^0.1.1",

View File

@ -18,6 +18,7 @@ specifiers:
cz-git: ^1.5.0
dayjs: ^1.11.7
element-plus: ^2.2.32
eruda: ^2.11.2
eslint: ^8.34.0
esno: ^0.16.3
fs-extra: ^11.1.0
@ -43,14 +44,15 @@ specifiers:
stylelint-config-standard-vue: ^1.0.0
stylelint-scss: ^4.4.0
svgo: ^3.0.2
terser: ^5.16.4
tinymce: ^6.3.1
typescript: ^4.9.5
unplugin-auto-import: ^0.14.3
unplugin-vue-components: ^0.24.0
vconsole: ^3.15.0
vite: ^4.1.2
vite-plugin-banner: ^0.7.0
vite-plugin-compression: ^0.5.1
vite-plugin-html: ^3.2.0
vite-plugin-mock: ^2.9.6
vite-plugin-pages: ^0.28.0
vite-plugin-spritesmith: ^0.1.1
@ -69,6 +71,7 @@ dependencies:
axios: 1.3.3
dayjs: 1.11.7
element-plus: 2.2.32_vue@3.2.47
eruda: 2.11.2
hotkeys-js: 3.10.1
lodash-es: 4.17.21
mitt: 3.0.0
@ -79,6 +82,7 @@ dependencies:
pinia: 2.0.30_hmuptsblhheur2tugfgucj7gc4
qs: 6.11.0
tinymce: 6.3.1
vconsole: 3.15.0
vue: 3.2.47
vue-router: 4.1.6_vue@3.2.47
@ -110,13 +114,13 @@ devDependencies:
stylelint-config-standard-vue: 1.0.0_qaaem4ytw5dycdgwcgrc5pmjki
stylelint-scss: 4.4.0_stylelint@15.1.0
svgo: 3.0.2
terser: 5.16.4
typescript: 4.9.5
unplugin-auto-import: 0.14.3_@vueuse+core@9.13.0
unplugin-vue-components: 0.24.0_vue@3.2.47
vite: 4.1.2_sass@1.58.3
vite: 4.1.2_sass@1.58.3+terser@5.16.4
vite-plugin-banner: 0.7.0
vite-plugin-compression: 0.5.1_vite@4.1.2
vite-plugin-html: 3.2.0_vite@4.1.2
vite-plugin-mock: 2.9.6_mockjs@1.1.0+vite@4.1.2
vite-plugin-pages: 0.28.0_vite@4.1.2
vite-plugin-spritesmith: 0.1.1
@ -632,6 +636,13 @@ packages:
- supports-color
dev: true
/@babel/runtime/7.21.0:
resolution: {integrity: sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==}
engines: {node: '>=6.9.0'}
dependencies:
regenerator-runtime: 0.13.11
dev: false
/@babel/standalone/7.20.15:
resolution: {integrity: sha512-B3LmZ1NHlTb2eFEaw8rftZc730Wh9MlmsH8ubb6IjsNoIk9+SQ2aAA0nrm/1806+PftPRAACPClmKTu8PG7Tew==}
engines: {node: '>=6.9.0'}
@ -1269,14 +1280,6 @@ packages:
picomatch: 2.3.1
dev: true
/@rollup/pluginutils/4.2.1:
resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==}
engines: {node: '>= 8.0.0'}
dependencies:
estree-walker: 2.0.2
picomatch: 2.3.1
dev: true
/@rollup/pluginutils/5.0.2:
resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==}
engines: {node: '>=14.0.0'}
@ -1569,7 +1572,7 @@ packages:
'@babel/core': 7.20.5
'@babel/plugin-transform-typescript': 7.20.2_@babel+core@7.20.5
'@vue/babel-plugin-jsx': 1.1.1_@babel+core@7.20.5
vite: 4.1.2_sass@1.58.3
vite: 4.1.2_sass@1.58.3+terser@5.16.4
vue: 3.2.47
transitivePeerDependencies:
- supports-color
@ -1582,7 +1585,7 @@ packages:
vite: ^4.0.0
vue: ^3.2.25
dependencies:
vite: 4.1.2_sass@1.58.3
vite: 4.1.2_sass@1.58.3+terser@5.16.4
vue: 3.2.47
dev: true
@ -1881,14 +1884,6 @@ packages:
- '@vue/composition-api'
- vue
/acorn-jsx/5.3.2_acorn@8.8.0:
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
peerDependencies:
acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
dependencies:
acorn: 8.8.0
dev: true
/acorn-jsx/5.3.2_acorn@8.8.2:
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
peerDependencies:
@ -1897,12 +1892,6 @@ packages:
acorn: 8.8.2
dev: true
/acorn/8.8.0:
resolution: {integrity: sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==}
engines: {node: '>=0.4.0'}
hasBin: true
dev: true
/acorn/8.8.2:
resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==}
engines: {node: '>=0.4.0'}
@ -2529,13 +2518,6 @@ packages:
static-extend: 0.1.2
dev: true
/clean-css/5.3.1:
resolution: {integrity: sha512-lCr8OHhiWCTw4v8POJovCoh4T7I9U11yVsPjMWWnnMmp9ZowCxyad1Pathle/9HjaDp+fdQKjO9fQydE6RHTZg==}
engines: {node: '>= 10.0'}
dependencies:
source-map: 0.6.1
dev: true
/clean-regexp/1.0.0:
resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==}
engines: {node: '>=4'}
@ -2654,11 +2636,6 @@ packages:
engines: {node: '>= 10'}
dev: true
/commander/8.3.0:
resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==}
engines: {node: '>= 12'}
dev: true
/commander/9.4.1:
resolution: {integrity: sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==}
engines: {node: ^12.20.0 || >=14}
@ -2680,11 +2657,6 @@ packages:
typedarray: 0.0.7
dev: true
/connect-history-api-fallback/1.6.0:
resolution: {integrity: sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==}
engines: {node: '>=0.8'}
dev: true
/connect/3.7.0:
resolution: {integrity: sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==}
engines: {node: '>= 0.10.0'}
@ -2725,6 +2697,16 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/copy-text-to-clipboard/3.0.1:
resolution: {integrity: sha512-rvVsHrpFcL4F2P8ihsoLdFHmd404+CMg71S756oRSeQgqk51U3kicGdnvfkrxva0xXH92SjGS62B0XIJsbh+9Q==}
engines: {node: '>=12'}
dev: false
/core-js/3.28.0:
resolution: {integrity: sha512-GiZn9D4Z/rSYvTeg1ljAIsEqFm0LaN9gVtwDCrKL80zHtS31p9BAjmTxVqTQDMpwlMolJZOFntUG2uwyj7DAqw==}
requiresBuild: true
dev: false
/core-util-is/1.0.2:
resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==}
dev: true
@ -3136,11 +3118,6 @@ packages:
tslib: 2.5.0
dev: true
/dotenv-expand/8.0.3:
resolution: {integrity: sha512-SErOMvge0ZUyWd5B0NXMQlDkN+8r+HhVUsxgOO7IoPDOdDRD2JjExpN6y3KnFR66jsJMwSn1pqIivhU5rcJiNg==}
engines: {node: '>=12'}
dev: true
/dotenv/16.0.3:
resolution: {integrity: sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==}
engines: {node: '>=12'}
@ -3161,14 +3138,6 @@ packages:
resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=}
dev: true
/ejs/3.1.8:
resolution: {integrity: sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==}
engines: {node: '>=0.10.0'}
hasBin: true
dependencies:
jake: 10.8.5
dev: true
/electron-to-chromium/1.4.284:
resolution: {integrity: sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==}
dev: true
@ -3251,6 +3220,10 @@ packages:
is-arrayish: 0.2.1
dev: true
/eruda/2.11.2:
resolution: {integrity: sha512-WN/o7sKlkOwGUDju0hCwfqvCmGiZFzWAbxT0LF+TA/kuJmcBPoNr0OMrnoEoKJWQqrVzVlZpLON4vegpsoSaPQ==}
dev: false
/es-abstract/1.20.4:
resolution: {integrity: sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==}
engines: {node: '>= 0.4'}
@ -3997,8 +3970,8 @@ packages:
resolution: {integrity: sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
acorn: 8.8.0
acorn-jsx: 5.3.2_acorn@8.8.0
acorn: 8.8.2
acorn-jsx: 5.3.2_acorn@8.8.2
eslint-visitor-keys: 3.3.0
dev: true
@ -4217,12 +4190,6 @@ packages:
flat-cache: 3.0.4
dev: true
/filelist/1.0.4:
resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==}
dependencies:
minimatch: 5.1.6
dev: true
/fill-range/4.0.0:
resolution: {integrity: sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==}
engines: {node: '>=0.10.0'}
@ -4837,20 +4804,6 @@ packages:
whatwg-encoding: 2.0.0
dev: true
/html-minifier-terser/6.1.0:
resolution: {integrity: sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw==}
engines: {node: '>=12'}
hasBin: true
dependencies:
camel-case: 4.1.2
clean-css: 5.3.1
commander: 8.3.0
he: 1.2.0
param-case: 3.0.4
relateurl: 0.2.7
terser: 5.15.1
dev: true
/html-tags/3.2.0:
resolution: {integrity: sha512-vy7ClnArOZwCnqZgvv+ddgHgJiAFXe3Ge9ML5/mBctVJoUoYPCdxVucOywjDARn6CVoh3dRSFdPHy2sX80L0Wg==}
engines: {node: '>=8'}
@ -5450,17 +5403,6 @@ packages:
resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==}
dev: true
/jake/10.8.5:
resolution: {integrity: sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==}
engines: {node: '>=10'}
hasBin: true
dependencies:
async: 3.2.4
chalk: 4.1.2
filelist: 1.0.4
minimatch: 3.1.2
dev: true
/jiti/1.17.0:
resolution: {integrity: sha512-CByzPgFqYoB9odEeef7GNmQ3S5THIBOtzRYoSCya2Sv27AuQxy2jgoFjQ6VTF53xsq1MXRm+YWNvOoDHUAteOw==}
hasBin: true
@ -6077,13 +6019,6 @@ packages:
brace-expansion: 1.1.11
dev: true
/minimatch/5.1.6:
resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
engines: {node: '>=10'}
dependencies:
brace-expansion: 2.0.1
dev: true
/minimatch/6.2.0:
resolution: {integrity: sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg==}
engines: {node: '>=10'}
@ -6198,6 +6133,10 @@ packages:
resolution: {integrity: sha512-YVE1mIJ4VpUMqZObFndk9CJu6DBJR/GB13p3tXuNbwD4XExaI5EOuRl6BHeIDxIqXZVxSfAC+y6U1Z/IxCfKUg==}
dev: true
/mutation-observer/1.0.3:
resolution: {integrity: sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA==}
dev: false
/mute-stream/0.0.8:
resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==}
dev: true
@ -6278,13 +6217,6 @@ packages:
resolution: {integrity: sha512-KIkvH1jl6b3O7es/0ShyCgWLcfXxlBrLBbP3rOr23WArC66IMcU4DeZEeYEOwnopYhawLTn7/y+YtmASe8DFVQ==}
dev: true
/node-html-parser/5.4.2:
resolution: {integrity: sha512-RaBPP3+51hPne/OolXxcz89iYvQvKOydaqoePpOgXcrOKZhjVIzmpKZz+Hd/RBO2/zN2q6CNJhQzucVz+u3Jyw==}
dependencies:
css-select: 4.3.0
he: 1.2.0
dev: true
/node-plop/0.31.1:
resolution: {integrity: sha512-qmXJJt3YETFt/e0dtMADVpvck6EvN01Jig086o+J3M6G++mWA7iJ3Pqz4m4kvlynh73Iz2/rcZzxq7xTiF+aIQ==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
@ -7186,6 +7118,10 @@ packages:
strip-indent: 3.0.0
dev: true
/regenerator-runtime/0.13.11:
resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==}
dev: false
/regex-not/1.0.2:
resolution: {integrity: sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==}
engines: {node: '>=0.10.0'}
@ -7220,11 +7156,6 @@ packages:
jsesc: 0.5.0
dev: true
/relateurl/0.2.7:
resolution: {integrity: sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==}
engines: {node: '>= 0.10'}
dev: true
/repeat-element/1.1.4:
resolution: {integrity: sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==}
engines: {node: '>=0.10.0'}
@ -8140,8 +8071,8 @@ packages:
yallist: 4.0.0
dev: true
/terser/5.15.1:
resolution: {integrity: sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==}
/terser/5.16.4:
resolution: {integrity: sha512-5yEGuZ3DZradbogeYQ1NaGz7rXVBDWujWlx1PT8efXO6Txn+eWbfKqB2bTDVmFXmePFkoLU6XI8UektMIEA0ug==}
engines: {node: '>=10'}
hasBin: true
dependencies:
@ -8604,6 +8535,15 @@ packages:
engines: {node: '>= 0.8'}
dev: true
/vconsole/3.15.0:
resolution: {integrity: sha512-8hq7wabPcRucSWQyN7/1tthMawP9JPvM95zgtMHpPknMMMCKj+abpoK7P7oKK4B0qw58C24Mdvo9+raUdpHyVQ==}
dependencies:
'@babel/runtime': 7.21.0
copy-text-to-clipboard: 3.0.1
core-js: 3.28.0
mutation-observer: 1.0.3
dev: false
/verror/1.10.0:
resolution: {integrity: sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=}
engines: {'0': node >=0.6.0}
@ -8644,31 +8584,11 @@ packages:
chalk: 4.1.2
debug: 4.3.4
fs-extra: 10.1.0
vite: 4.1.2_sass@1.58.3
vite: 4.1.2_sass@1.58.3+terser@5.16.4
transitivePeerDependencies:
- supports-color
dev: true
/vite-plugin-html/3.2.0_vite@4.1.2:
resolution: {integrity: sha512-2VLCeDiHmV/BqqNn5h2V+4280KRgQzCFN47cst3WiNK848klESPQnzuC3okH5XHtgwHH/6s1Ho/YV6yIO0pgoQ==}
peerDependencies:
vite: '>=2.0.0'
dependencies:
'@rollup/pluginutils': 4.2.1
colorette: 2.0.19
connect-history-api-fallback: 1.6.0
consola: 2.15.3
dotenv: 16.0.3
dotenv-expand: 8.0.3
ejs: 3.1.8
fast-glob: 3.2.12
fs-extra: 10.1.0
html-minifier-terser: 6.1.0
node-html-parser: 5.4.2
pathe: 0.2.0
vite: 4.1.2_sass@1.58.3
dev: true
/vite-plugin-mock/2.9.6_mockjs@1.1.0+vite@4.1.2:
resolution: {integrity: sha512-/Rm59oPppe/ncbkSrUuAxIQihlI2YcBmnbR4ST1RA2VzM1C0tEQc1KlbQvnUGhXECAGTaQN2JyasiwXP6EtKgg==}
engines: {node: '>=12.0.0'}
@ -8686,7 +8606,7 @@ packages:
fast-glob: 3.2.12
mockjs: 1.1.0
path-to-regexp: 6.2.1
vite: 4.1.2_sass@1.58.3
vite: 4.1.2_sass@1.58.3+terser@5.16.4
transitivePeerDependencies:
- rollup
- supports-color
@ -8709,7 +8629,7 @@ packages:
json5: 2.2.1
local-pkg: 0.4.2
picocolors: 1.0.0
vite: 4.1.2_sass@1.58.3
vite: 4.1.2_sass@1.58.3+terser@5.16.4
yaml: 2.1.3
transitivePeerDependencies:
- supports-color
@ -8739,7 +8659,7 @@ packages:
pathe: 0.2.0
svg-baker: 1.7.0
svgo: 2.8.0
vite: 4.1.2_sass@1.58.3
vite: 4.1.2_sass@1.58.3+terser@5.16.4
transitivePeerDependencies:
- supports-color
dev: true
@ -8758,7 +8678,7 @@ packages:
kolorist: 1.6.0
magic-string: 0.27.0
shell-quote: 1.7.4
vite: 4.1.2_sass@1.58.3
vite: 4.1.2_sass@1.58.3+terser@5.16.4
transitivePeerDependencies:
- supports-color
dev: true
@ -8773,7 +8693,7 @@ packages:
'@vue/compiler-sfc': 3.2.47
debug: 4.3.4
fast-glob: 3.2.12
vite: 4.1.2_sass@1.58.3
vite: 4.1.2_sass@1.58.3+terser@5.16.4
vue: 3.2.47
vue-router: 4.1.6_vue@3.2.47
transitivePeerDependencies:
@ -8787,10 +8707,10 @@ packages:
dependencies:
'@vue/compiler-sfc': 3.2.41
magic-string: 0.25.9
vite: 4.1.2_sass@1.58.3
vite: 4.1.2_sass@1.58.3+terser@5.16.4
dev: true
/vite/4.1.2_sass@1.58.3:
/vite/4.1.2_sass@1.58.3+terser@5.16.4:
resolution: {integrity: sha512-MWDb9Rfy3DI8omDQySbMK93nQqStwbsQWejXRY2EBzEWKmLAXWb1mkI9Yw2IJrc+oCvPCI1Os5xSSIBYY6DEAw==}
engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true
@ -8820,6 +8740,7 @@ packages:
resolve: 1.22.1
rollup: 3.15.0
sass: 1.58.3
terser: 5.16.4
optionalDependencies:
fsevents: 2.3.2
dev: true

View File

@ -1,119 +1,49 @@
#app {
height: 100%;
}
.fantastic-admin-home {
position: absolute;
z-index: 10000;
top: 0;
left: 0;
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
user-select: none;
color: #736477;
background-color: snow;
}
.fantastic-admin-home .loading {
height: 40px;
width: 40px;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
.fantastic-admin-home .square {
display: flex;
align-items: center;
justify-content: center;
height: 20px;
width: 20px;
}
.fantastic-admin-home .square::before {
content: "";
width: 10px;
height: 10px;
border-radius: 15%;
border: 3px solid #8c858f;
}
.fantastic-admin-home .loading.animate .square::before {
animation: square-to-dot-animation 1.2s linear;
}
.fantastic-admin-home .loading.animate .square:nth-child(1)::before {
animation-delay: calc(100ms * 1);
}
.fantastic-admin-home .loading.animate .square:nth-child(2)::before {
animation-delay: calc(100ms * 2);
}
.fantastic-admin-home .loading.animate .square:nth-child(3)::before {
animation-delay: calc(100ms * 3);
}
.fantastic-admin-home .loading.animate .square:nth-child(4)::before {
animation-delay: calc(100ms * 4);
}
@keyframes square-to-dot-animation {
15%,
55% {
border-radius: 100%;
width: 0;
height: 0;
margin: 5px;
border-width: 5px;
}
70% {
border-radius: 15%;
width: 10px;
height: 10px;
margin: initial;
border-width: 3px;
}
}
.fantastic-admin-home .text {
font-size: 24px;
margin-top: 20px;
}
#browser-upgrade {
position: absolute;
z-index: 10001;
top: 0;
left: 0;
height: 100%;
width: 100%;
display: none;
user-select: none;
color: #736477;
background-color: snow;
position: absolute;
z-index: 10001;
top: 0;
left: 0;
height: 100%;
width: 100%;
display: none;
user-select: none;
color: #736477;
background-color: snow;
}
#browser-upgrade .title {
margin: 40px 0;
text-align: center;
font-size: 24px;
margin: 40px 0;
text-align: center;
font-size: 24px;
}
#browser-upgrade .browsers {
text-align: center;
text-align: center;
}
#browser-upgrade .browsers .browser {
display: inline-block;
margin: 0 20px;
cursor: pointer;
text-decoration: none;
display: inline-block;
margin: 0 20px;
cursor: pointer;
text-decoration: none;
}
#browser-upgrade .browsers .browser .browser-icon {
display: block;
width: 50px;
height: 50px;
margin: 0 auto;
border: none;
display: block;
width: 50px;
height: 50px;
margin: 0 auto;
border: none;
}
#browser-upgrade .browsers .browser .browser-name {
text-align: center;
margin-top: 10px;
padding-bottom: 2px;
color: #736477;
border-bottom: 1px solid transparent;
text-align: center;
margin-top: 10px;
padding-bottom: 2px;
color: #736477;
border-bottom: 1px solid transparent;
}
#browser-upgrade .browsers .browser:hover .browser-name {
border-bottom: 1px solid #736477;
border-bottom: 1px solid #736477;
}

92
public/loading.css Normal file
View File

@ -0,0 +1,92 @@
#app {
height: 100%;
}
.fantastic-admin-home {
position: absolute;
z-index: 10000;
top: 0;
left: 0;
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
user-select: none;
color: #736477;
background-color: snow;
}
.fantastic-admin-home .loading {
height: 40px;
width: 40px;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
.fantastic-admin-home .loading .square {
display: flex;
align-items: center;
justify-content: center;
height: 20px;
width: 20px;
}
.fantastic-admin-home .loading .square::before {
content: "";
width: 10px;
height: 10px;
border-radius: 15%;
border: 3px solid #8c858f;
animation: square-to-dot-animation 2s linear infinite;
}
.fantastic-admin-home .loading .square:nth-child(1)::before {
animation-delay: calc(150ms * 1);
}
.fantastic-admin-home .loading .square:nth-child(2)::before {
animation-delay: calc(150ms * 2);
}
.fantastic-admin-home .loading .square:nth-child(3)::before {
animation-delay: calc(150ms * 3);
}
.fantastic-admin-home .loading .square:nth-child(4)::before {
animation-delay: calc(150ms * 4);
}
@keyframes square-to-dot-animation {
15%,
25% {
border-radius: 100%;
width: 0;
height: 0;
margin: 5px;
border-width: 5px;
}
40% {
border-radius: 15%;
width: 10px;
height: 10px;
margin: initial;
border-width: 3px;
}
}
.fantastic-admin-home .text {
position: relative;
font-size: 24px;
margin-top: 20px;
}
.fantastic-admin-home .text::after {
content: '…';
position: absolute;
padding-left: 5px;
}

View File

@ -1,4 +1,6 @@
<script lang="ts" setup>
import eruda from 'eruda'
import VConsole from 'vconsole'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import hotkeys from 'hotkeys-js'
import eventBus from './utils/eventBus'
@ -50,6 +52,9 @@ onMounted(() => {
eventBus.emit('global-system-info-toggle')
})
})
import.meta.env.VITE_APP_DEBUG_TOOL === 'eruda' && eruda.init()
import.meta.env.VITE_APP_DEBUG_TOOL === 'vconsole' && new VConsole()
</script>
<template>

View File

@ -1,4 +1,4 @@
import { createApp } from 'vue'
import './utils/system.copyright'
import ElementPlus from 'element-plus'
import App from './App.vue'
import pinia from './store'

View File

@ -0,0 +1,15 @@
/* eslint-disable no-console */
// 请勿删除
if (import.meta.env.PROD) {
const copyright_common_style = 'font-size: 14px; margin-bottom: 2px; padding: 6px 8px; color: #fff;'
const copyright_main_style = `${copyright_common_style} background: #e24329;`
const copyright_sub_style = `${copyright_common_style} background: #707070;`
if ((navigator.language).toLowerCase() === 'zh-cn') {
console.info('%c由%cFantastic-admin%c驱动', copyright_sub_style, copyright_main_style, copyright_sub_style, '\nhttps://gitee.com/hooray/fantastic-admin')
}
else {
console.info('%cPowered by%cFantastic-admin', copyright_sub_style, copyright_main_style, '\nhttps://github.com/hooray/fantastic-admin')
}
}
export {}

View File

@ -1,70 +0,0 @@
import { createHtmlPlugin } from 'vite-plugin-html'
export default function createHtml(env, isBuild) {
const { VITE_APP_TITLE, VITE_APP_DEBUG_TOOL } = env
let copyrightScript = ''
if (isBuild) {
const copyright_common_style = 'font-size: 14px; margin-bottom: 2px; padding: 6px 8px; color: #fff;'
const copyright_main_style = `${copyright_common_style} background: #e24329;`
const copyright_sub_style = `${copyright_common_style} background: #707070;`
copyrightScript += `
<script>
if ((navigator.language || navigator.browserLanguage).toLowerCase() === 'zh-cn') {
console.info('%c由%cFantastic-admin%c驱动', '${copyright_sub_style}', '${copyright_main_style}', '${copyright_sub_style}', '\\nhttps://gitee.com/hooray/fantastic-admin');
} else {
console.info('%cPowered by%cFantastic-admin', '${copyright_sub_style}', '${copyright_main_style}', '\\nhttps://github.com/hooray/fantastic-admin');
}
</script>
`
}
let devtoolScript = ''
switch (VITE_APP_DEBUG_TOOL) {
case 'eruda':
devtoolScript = `
<script src="//unpkg.com/eruda/eruda.js"></script>
<script>
eruda.init()
</script>
`
break
case 'vconsole':
devtoolScript = `
<script src="//unpkg.com/vconsole/dist/vconsole.min.js"></script>
<script>
new VConsole()
</script>
`
break
}
const loadingScript = `
<script>
(function(){
if(!!window.ActiveXObject || "ActiveXObject" in window) {
document.getElementById('browser-upgrade').style.display = 'block'
} else {
var Loading = document.querySelector('.loading')
Loading.classList.add('animate')
Loading.addEventListener('animationend', function() {
setTimeout(function() {
Loading.classList.remove('animate')
}, 600)
setTimeout(function() {
Loading.classList.add('animate')
}, 1000)
})
}
})()
</script>
`
return createHtmlPlugin({
inject: {
data: {
title: VITE_APP_TITLE,
copyrightScript,
loadingScript,
devtoolScript,
},
},
minify: isBuild,
})
}

View File

@ -3,7 +3,6 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import createInspector from './inspector'
import createHtml from './html'
import createAutoImport from './auto-import'
import createComponents from './components'
import createSetupExtend from './setup-extend'
@ -23,7 +22,6 @@ export default function createVitePlugins(viteEnv, isBuild = false) {
vueJsx(),
]
vitePlugins.push(createInspector())
vitePlugins.push(createHtml(viteEnv, isBuild))
vitePlugins.push(createAutoImport())
vitePlugins.push(createComponents())
vitePlugins.push(createSetupExtend())