From 277734d520fa44a5806fcc71bffcb9b5813df714 Mon Sep 17 00:00:00 2001 From: lastsunday Date: Sat, 21 Dec 2024 03:09:53 +0800 Subject: [PATCH] build: add iconify resource in app --- CHANGELOG.md | 6 ++++ package.json | 2 ++ pnpm-lock.yaml | 83 ++++++++++++++++++++++++++++++++++++++++++-------- wxt.config.ts | 3 +- 4 files changed, 80 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c608f9..f5b06c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,15 @@ 1. (Sidepanel)修复主页图表默认显示tooltip的问题。 +### 🔗 Build + +1. 新增iconify图标离线打包。 + ### 🔨 Dependency 1. Update @ant-design/charts ^2.2.5 +2. Add @iconify/json ^2.2.286 +3. Add unplugin-icons ^0.22.0 ## 2.2.0(2024-12-20) diff --git a/package.json b/package.json index db70b71..6feebb0 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "@ant-design/charts": "^2.2.5", "@ant-design/icons": "^5.5.1", "@ant-design/pro-components": "^2.8.2", + "@iconify/json": "^2.2.286", "@pansy/lnglat-transform": "^1.0.3", "@tsparticles/react": "^3.0.0", "@types/geojson": "^7946.0.14", @@ -84,6 +85,7 @@ "typescript": "^5.7.2", "typescript-eslint": "^8.16.0", "unocss": "^0.65.1", + "unplugin-icons": "^0.22.0", "vite-plugin-wasm": "^3.3.0", "vite-plugin-web-extension": "^4.1.6", "web-ext": "^8.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f0e9881..4a6175e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: '@ant-design/pro-components': specifier: ^2.8.2 version: 2.8.2(antd@5.22.2(moment@2.30.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(rc-field-form@2.5.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@iconify/json': + specifier: ^2.2.286 + version: 2.2.286 '@pansy/lnglat-transform': specifier: ^1.0.3 version: 1.0.3 @@ -201,6 +204,9 @@ importers: unocss: specifier: ^0.65.1 version: 0.65.1(postcss@8.4.49)(rollup@4.27.4)(vite@6.0.1(@types/node@22.5.4)(jiti@1.21.6)(lightningcss@1.28.1)(sass@1.78.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.5.1))(vue@3.5.13(typescript@5.7.2)) + unplugin-icons: + specifier: ^0.22.0 + version: 0.22.0(@vue/compiler-sfc@3.5.13) vite-plugin-wasm: specifier: ^3.3.0 version: 3.3.0(vite@6.0.1(@types/node@22.5.4)(jiti@1.21.6)(lightningcss@1.28.1)(sass@1.78.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.5.1)) @@ -379,6 +385,9 @@ packages: '@antfu/install-pkg@0.4.1': resolution: {integrity: sha512-T7yB5QNG29afhWVkVq7XeIMBa5U/vs9mX69YqayXypPRmYzUmzwnYltplHmPtZ4HPCn+sQKeXW8I47wCbuBOjw==} + '@antfu/install-pkg@0.5.0': + resolution: {integrity: sha512-dKnk2xlAyC7rvTkpkHmu+Qy/2Zc3Vm/l8PtNyIOGDBtXPY3kThfU4ORNEp3V7SXw5XSOb+tOJaUYpfquPzL/Tg==} + '@antfu/utils@0.7.10': resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} @@ -1301,6 +1310,9 @@ packages: resolution: {integrity: sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==} engines: {node: '>=18.18'} + '@iconify/json@2.2.286': + resolution: {integrity: sha512-tVl/fYvCyU5flYl4zfuJgig+ZEnpG3DJdTTTIjsiPu7xsk4s0gT1BktWvcFGr2B4UUiTRdb+XHWzW8Eu9WwhKQ==} + '@iconify/react@5.0.2': resolution: {integrity: sha512-wtmstbYlEbo4NDxFxBJkhkf9gJBDqMGr7FaqLrAUMneRV3Z+fVHLJjOhWbkAF8xDQNFC/wcTYdrWo1lnRhmagQ==} peerDependencies: @@ -2466,11 +2478,6 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} - engines: {node: '>=0.4.0'} - hasBin: true - acorn@8.14.0: resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} engines: {node: '>=0.4.0'} @@ -6727,10 +6734,37 @@ packages: vite: optional: true + unplugin-icons@0.22.0: + resolution: {integrity: sha512-CP+iZq5U7doOifer5bcM0jQ9t3Is7EGybIYt3myVxceI8Zuk8EZEpe1NPtJvh7iqMs1VdbK0L41t9+um9VuuLw==} + peerDependencies: + '@svgr/core': '>=7.0.0' + '@svgx/core': ^1.0.1 + '@vue/compiler-sfc': ^3.0.2 || ^2.7.0 + svelte: ^3.0.0 || ^4.0.0 || ^5.0.0 + vue-template-compiler: ^2.6.12 + vue-template-es2015-compiler: ^1.9.0 + peerDependenciesMeta: + '@svgr/core': + optional: true + '@svgx/core': + optional: true + '@vue/compiler-sfc': + optional: true + svelte: + optional: true + vue-template-compiler: + optional: true + vue-template-es2015-compiler: + optional: true + unplugin@1.16.0: resolution: {integrity: sha512-5liCNPuJW8dqh3+DM6uNM2EI3MLLpCKp/KY+9pB5M2S2SR2qvvDHhKgBOaTWEbZTAws3CXfB0rKTIolWKL05VQ==} engines: {node: '>=14.0.0'} + unplugin@2.1.0: + resolution: {integrity: sha512-us4j03/499KhbGP8BU7Hrzrgseo+KdfJYWcbcajCOqsAyb8Gk0Yn2kiUIcZISYCb1JFaZfIuG3b42HmguVOKCQ==} + engines: {node: '>=18.12.0'} + untildify@4.0.0: resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} engines: {node: '>=8'} @@ -7461,6 +7495,11 @@ snapshots: package-manager-detector: 0.2.7 tinyexec: 0.3.1 + '@antfu/install-pkg@0.5.0': + dependencies: + package-manager-detector: 0.2.7 + tinyexec: 0.3.1 + '@antfu/utils@0.7.10': {} '@antv/algorithm@0.1.26': @@ -8625,6 +8664,11 @@ snapshots: '@humanwhocodes/retry@0.4.1': {} + '@iconify/json@2.2.286': + dependencies: + '@iconify/types': 2.0.0 + pathe: 1.1.2 + '@iconify/react@5.0.2(react@18.3.1)': dependencies: '@iconify/types': 2.0.0 @@ -10020,16 +10064,10 @@ snapshots: dependencies: event-target-shim: 5.0.1 - acorn-jsx@5.3.2(acorn@8.12.1): - dependencies: - acorn: 8.12.1 - acorn-jsx@5.3.2(acorn@8.14.0): dependencies: acorn: 8.14.0 - acorn@8.12.1: {} - acorn@8.14.0: {} add-dom-event-listener@1.1.0: @@ -11403,8 +11441,8 @@ snapshots: espree@10.0.1: dependencies: - acorn: 8.12.1 - acorn-jsx: 5.3.2(acorn@8.12.1) + acorn: 8.14.0 + acorn-jsx: 5.3.2(acorn@8.14.0) eslint-visitor-keys: 4.0.0 espree@10.3.0: @@ -15171,11 +15209,30 @@ snapshots: - supports-color - vue + unplugin-icons@0.22.0(@vue/compiler-sfc@3.5.13): + dependencies: + '@antfu/install-pkg': 0.5.0 + '@antfu/utils': 0.7.10 + '@iconify/utils': 2.2.0 + debug: 4.4.0 + kolorist: 1.8.0 + local-pkg: 0.5.1 + unplugin: 2.1.0 + optionalDependencies: + '@vue/compiler-sfc': 3.5.13 + transitivePeerDependencies: + - supports-color + unplugin@1.16.0: dependencies: acorn: 8.14.0 webpack-virtual-modules: 0.6.2 + unplugin@2.1.0: + dependencies: + acorn: 8.14.0 + webpack-virtual-modules: 0.6.2 + untildify@4.0.0: {} upath@2.0.1: {} diff --git a/wxt.config.ts b/wxt.config.ts index 3a0ab6a..0052e8e 100644 --- a/wxt.config.ts +++ b/wxt.config.ts @@ -1,6 +1,7 @@ import react from "@vitejs/plugin-react-swc"; import { copyFileSync } from "fs"; import { resolve } from "path"; +import Icons from 'unplugin-icons/vite'; import wasm from "vite-plugin-wasm"; import { defineConfig } from 'wxt'; @@ -82,7 +83,7 @@ export default defineConfig({ } }, plugins: () => { - [react(), wasm()] + [react(), wasm(), Icons(),] }, worker: { plugins: () => [wasm()]