Commit 404c73de450c165ffe623ca2969322bae1786a73
1 parent
abde5c3a
perf: pwa icon
Showing
6 changed files
with
35 additions
and
20 deletions
build/vite/plugin/index.ts
@@ -45,10 +45,26 @@ export function createVitePlugins(viteEnv: ViteEnv) { | @@ -45,10 +45,26 @@ export function createVitePlugins(viteEnv: ViteEnv) { | ||
45 | vitePlugins.push(PurgeIcons()); | 45 | vitePlugins.push(PurgeIcons()); |
46 | 46 | ||
47 | if (isProdFn() && VITE_USE_PWA) { | 47 | if (isProdFn() && VITE_USE_PWA) { |
48 | - console.log('======================'); | ||
49 | - console.log(VITE_USE_PWA); | ||
50 | - console.log('======================'); | ||
51 | - vitePlugins.push(VitePWA()); | 48 | + vitePlugins.push( |
49 | + VitePWA({ | ||
50 | + manifest: { | ||
51 | + name: 'Vben Admin', | ||
52 | + short_name: 'vben_admin', | ||
53 | + icons: [ | ||
54 | + { | ||
55 | + src: './resource/img/pwa-192x192.png', | ||
56 | + sizes: '192x192', | ||
57 | + type: 'image/png', | ||
58 | + }, | ||
59 | + { | ||
60 | + src: './resource/img/pwa-512x512.png', | ||
61 | + sizes: '512x512', | ||
62 | + type: 'image/png', | ||
63 | + }, | ||
64 | + ], | ||
65 | + }, | ||
66 | + }) | ||
67 | + ); | ||
52 | } | 68 | } |
53 | 69 | ||
54 | // vite-plugin-mock | 70 | // vite-plugin-mock |
package.json
@@ -46,7 +46,7 @@ | @@ -46,7 +46,7 @@ | ||
46 | "@iconify/json": "^1.1.248", | 46 | "@iconify/json": "^1.1.248", |
47 | "@ls-lint/ls-lint": "^1.9.2", | 47 | "@ls-lint/ls-lint": "^1.9.2", |
48 | "@purge-icons/generated": "^0.4.1", | 48 | "@purge-icons/generated": "^0.4.1", |
49 | - "@types/echarts": "^4.8.3", | 49 | + "@types/echarts": "^4.9.0", |
50 | "@types/fs-extra": "^9.0.2", | 50 | "@types/fs-extra": "^9.0.2", |
51 | "@types/koa-static": "^4.0.1", | 51 | "@types/koa-static": "^4.0.1", |
52 | "@types/lodash-es": "^4.17.3", | 52 | "@types/lodash-es": "^4.17.3", |
@@ -66,7 +66,7 @@ | @@ -66,7 +66,7 @@ | ||
66 | "cross-env": "^7.0.2", | 66 | "cross-env": "^7.0.2", |
67 | "dotenv": "^8.2.0", | 67 | "dotenv": "^8.2.0", |
68 | "eslint": "^7.12.0", | 68 | "eslint": "^7.12.0", |
69 | - "eslint-config-prettier": "^6.14.0", | 69 | + "eslint-config-prettier": "^6.15.0", |
70 | "eslint-plugin-prettier": "^3.1.4", | 70 | "eslint-plugin-prettier": "^3.1.4", |
71 | "eslint-plugin-vue": "^7.1.0", | 71 | "eslint-plugin-vue": "^7.1.0", |
72 | "esno": "^0.2.4", | 72 | "esno": "^0.2.4", |
@@ -91,7 +91,7 @@ | @@ -91,7 +91,7 @@ | ||
91 | "vite-plugin-html": "^1.0.0-beta.2", | 91 | "vite-plugin-html": "^1.0.0-beta.2", |
92 | "vite-plugin-mock": "^1.0.6", | 92 | "vite-plugin-mock": "^1.0.6", |
93 | "vite-plugin-purge-icons": "^0.4.4", | 93 | "vite-plugin-purge-icons": "^0.4.4", |
94 | - "vite-plugin-pwa": "^0.1.2", | 94 | + "vite-plugin-pwa": "^0.1.3", |
95 | "vue-eslint-parser": "^7.1.1", | 95 | "vue-eslint-parser": "^7.1.1", |
96 | "yargs": "^16.1.0" | 96 | "yargs": "^16.1.0" |
97 | }, | 97 | }, |
public/resource/img/pwa-192x192.png
0 → 100644
11.9 KB
public/resource/img/pwa-512x512.png
0 → 100644
51.4 KB
src/views/sys/login/Login.vue
@@ -15,7 +15,6 @@ | @@ -15,7 +15,6 @@ | ||
15 | </a-form-item> | 15 | </a-form-item> |
16 | <a-form-item name="password"> | 16 | <a-form-item name="password"> |
17 | <a-input-password | 17 | <a-input-password |
18 | - autofocus="autofocus" | ||
19 | size="large" | 18 | size="large" |
20 | visibilityToggle | 19 | visibilityToggle |
21 | v-model:value="formData.password" | 20 | v-model:value="formData.password" |
yarn.lock
@@ -1275,10 +1275,10 @@ | @@ -1275,10 +1275,10 @@ | ||
1275 | "@types/keygrip" "*" | 1275 | "@types/keygrip" "*" |
1276 | "@types/node" "*" | 1276 | "@types/node" "*" |
1277 | 1277 | ||
1278 | -"@types/echarts@^4.8.3": | ||
1279 | - version "4.8.3" | ||
1280 | - resolved "https://registry.npmjs.org/@types/echarts/-/echarts-4.8.3.tgz#78ef1ede01c3705b52342da997b3d54571d3604e" | ||
1281 | - integrity sha512-5aFZ7/6f+SPonLh4Nuso6pEZWwX8VBMYh2e83x1GVEpGkcN3GC0HzxPoF6ZSZPwoe5Rg4bhNwD9f2TVYxgU/QQ== | 1278 | +"@types/echarts@^4.9.0": |
1279 | + version "4.9.0" | ||
1280 | + resolved "https://registry.npmjs.org/@types/echarts/-/echarts-4.9.0.tgz#e133ea5429ada1d814f9cc1deae855421dcdd2ef" | ||
1281 | + integrity sha512-9QIAUe6cxM5GyGNCIhlEwf7l5oclZDVM0HNRfehPx3dDUt1Jfhbvp/U2wfgwtL/IDqyASBVs1zu4qyaCsuJINA== | ||
1282 | dependencies: | 1282 | dependencies: |
1283 | "@types/zrender" "*" | 1283 | "@types/zrender" "*" |
1284 | 1284 | ||
@@ -3267,10 +3267,10 @@ escape-string-regexp@^1.0.5: | @@ -3267,10 +3267,10 @@ escape-string-regexp@^1.0.5: | ||
3267 | resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" | 3267 | resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" |
3268 | integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= | 3268 | integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= |
3269 | 3269 | ||
3270 | -eslint-config-prettier@^6.14.0: | ||
3271 | - version "6.14.0" | ||
3272 | - resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.14.0.tgz#390e7863a8ae99970981933826476169285b3a27" | ||
3273 | - integrity sha512-DbVwh0qZhAC7CNDWcq8cBdK6FcVHiMTKmCypOPWeZkp9hJ8xYwTaWSa6bb6cjfi8KOeJy0e9a8Izxyx+O4+gCQ== | 3270 | +eslint-config-prettier@^6.15.0: |
3271 | + version "6.15.0" | ||
3272 | + resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz#7f93f6cb7d45a92f1537a70ecc06366e1ac6fed9" | ||
3273 | + integrity sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw== | ||
3274 | dependencies: | 3274 | dependencies: |
3275 | get-stdin "^6.0.0" | 3275 | get-stdin "^6.0.0" |
3276 | 3276 | ||
@@ -8016,10 +8016,10 @@ vite-plugin-purge-icons@^0.4.4: | @@ -8016,10 +8016,10 @@ vite-plugin-purge-icons@^0.4.4: | ||
8016 | "@purge-icons/generated" "^0.4.1" | 8016 | "@purge-icons/generated" "^0.4.1" |
8017 | rollup-plugin-purge-icons "^0.4.4" | 8017 | rollup-plugin-purge-icons "^0.4.4" |
8018 | 8018 | ||
8019 | -vite-plugin-pwa@^0.1.2: | ||
8020 | - version "0.1.2" | ||
8021 | - resolved "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.1.2.tgz#286b1b22a3b56268477defcd1e4a0029f09fcd06" | ||
8022 | - integrity sha512-u+jRU+4q0jHZ/xplsi+QbJA3dJB2/sA6CeH5to48/asxW3Zl3A9byqAnucbgX8mOswYUc/MhpSIK/B1ZartI3A== | 8019 | +vite-plugin-pwa@^0.1.3: |
8020 | + version "0.1.3" | ||
8021 | + resolved "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.1.3.tgz#e3934ffd1c916cd336ae45517d373f8114c740f4" | ||
8022 | + integrity sha512-WZ1zMQyXpZVprX69zD8KFYb0mcVKtacktXYfSNVPQl3mG1Ucsm6tl398eIZOshVEzhlRvUDH8xcLAB26+2sDeg== | ||
8023 | dependencies: | 8023 | dependencies: |
8024 | debug "^4.3.0" | 8024 | debug "^4.3.0" |
8025 | fast-glob "^3.2.4" | 8025 | fast-glob "^3.2.4" |