diff --git a/package.json b/package.json index 917430f..08dfc08 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,9 @@ "less": "^4.2.0", "lint-staged": "^15.2.9", "npm-run-all2": "^6.2.2", + "pinyin-pro": "^3.24.2", "prettier": "^3.3.3", + "rollup": "^4.21.0", "typescript": "~5.5.4", "unocss": "^0.62.0", "unplugin-auto-import": "^0.18.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 73a9ab8..349e090 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -146,36 +146,42 @@ importers: npm-run-all2: specifier: ^6.2.2 version: 6.2.2 + pinyin-pro: + specifier: ^3.24.2 + version: 3.24.2 prettier: specifier: ^3.3.3 version: 3.3.3 + rollup: + specifier: ^4.21.0 + version: 4.21.0 typescript: specifier: ~5.5.4 version: 5.5.4 unocss: specifier: ^0.62.0 - version: 0.62.1(postcss@8.4.41)(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) + version: 0.62.1(postcss@8.4.41)(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) unplugin-auto-import: specifier: ^0.18.2 - version: 0.18.2(@vueuse/core@10.7.0(vue@3.4.37(typescript@5.5.4)))(rollup@4.20.0) + version: 0.18.2(@vueuse/core@10.7.0(vue@3.4.37(typescript@5.5.4)))(rollup@4.21.0) unplugin-vue-components: specifier: ^0.27.3 - version: 0.27.4(@babel/parser@7.25.3)(rollup@4.20.0)(vue@3.4.37(typescript@5.5.4)) + version: 0.27.4(@babel/parser@7.25.3)(rollup@4.21.0)(vue@3.4.37(typescript@5.5.4)) unplugin-vue-markdown: specifier: ^0.26.2 - version: 0.26.2(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) + version: 0.26.2(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) unplugin-vue-router: specifier: ^0.10.2 - version: 0.10.3(rollup@4.20.0)(vue-router@4.4.3(patch_hash=srtmpgmwmi3z5x3wdppdguh7mi)(vue@3.4.37(typescript@5.5.4)))(vue@3.4.37(typescript@5.5.4)) + version: 0.10.3(rollup@4.21.0)(vue-router@4.4.3(patch_hash=srtmpgmwmi3z5x3wdppdguh7mi)(vue@3.4.37(typescript@5.5.4)))(vue@3.4.37(typescript@5.5.4)) vite: specifier: ^5.4.0 version: 5.4.0(@types/node@22.2.0)(less@4.2.0) vite-plugin-cdn-import: specifier: ^1.0.1 - version: 1.0.1(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) + version: 1.0.1(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) vite-plugin-vue-devtools: specifier: ^7.3.7 - version: 7.3.8(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0))(vue@3.4.37(typescript@5.5.4)) + version: 7.3.8(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0))(vue@3.4.37(typescript@5.5.4)) vitest: specifier: ^2.0.5 version: 2.0.5(@types/node@22.2.0)(jsdom@24.1.1)(less@4.2.0) @@ -753,92 +759,92 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.20.0': - resolution: {integrity: sha512-TSpWzflCc4VGAUJZlPpgAJE1+V60MePDQnBd7PPkpuEmOy8i87aL6tinFGKBFKuEDikYpig72QzdT3QPYIi+oA==, tarball: https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.20.0.tgz} + '@rollup/rollup-android-arm-eabi@4.21.0': + resolution: {integrity: sha512-WTWD8PfoSAJ+qL87lE7votj3syLavxunWhzCnx3XFxFiI/BA/r3X7MUM8dVrH8rb2r4AiO8jJsr3ZjdaftmnfA==, tarball: https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.0.tgz} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.20.0': - resolution: {integrity: sha512-u00Ro/nok7oGzVuh/FMYfNoGqxU5CPWz1mxV85S2w9LxHR8OoMQBuSk+3BKVIDYgkpeOET5yXkx90OYFc+ytpQ==, tarball: https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.20.0.tgz} + '@rollup/rollup-android-arm64@4.21.0': + resolution: {integrity: sha512-a1sR2zSK1B4eYkiZu17ZUZhmUQcKjk2/j9Me2IDjk1GHW7LB5Z35LEzj9iJch6gtUfsnvZs1ZNyDW2oZSThrkA==, tarball: https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.0.tgz} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.20.0': - resolution: {integrity: sha512-uFVfvzvsdGtlSLuL0ZlvPJvl6ZmrH4CBwLGEFPe7hUmf7htGAN+aXo43R/V6LATyxlKVC/m6UsLb7jbG+LG39Q==, tarball: https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.20.0.tgz} + '@rollup/rollup-darwin-arm64@4.21.0': + resolution: {integrity: sha512-zOnKWLgDld/svhKO5PD9ozmL6roy5OQ5T4ThvdYZLpiOhEGY+dp2NwUmxK0Ld91LrbjrvtNAE0ERBwjqhZTRAA==, tarball: https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.0.tgz} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.20.0': - resolution: {integrity: sha512-xbrMDdlev53vNXexEa6l0LffojxhqDTBeL+VUxuuIXys4x6xyvbKq5XqTXBCEUA8ty8iEJblHvFaWRJTk/icAQ==, tarball: https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.20.0.tgz} + '@rollup/rollup-darwin-x64@4.21.0': + resolution: {integrity: sha512-7doS8br0xAkg48SKE2QNtMSFPFUlRdw9+votl27MvT46vo44ATBmdZdGysOevNELmZlfd+NEa0UYOA8f01WSrg==, tarball: https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.0.tgz} cpu: [x64] os: [darwin] - '@rollup/rollup-linux-arm-gnueabihf@4.20.0': - resolution: {integrity: sha512-jMYvxZwGmoHFBTbr12Xc6wOdc2xA5tF5F2q6t7Rcfab68TT0n+r7dgawD4qhPEvasDsVpQi+MgDzj2faOLsZjA==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.20.0.tgz} + '@rollup/rollup-linux-arm-gnueabihf@4.21.0': + resolution: {integrity: sha512-pWJsfQjNWNGsoCq53KjMtwdJDmh/6NubwQcz52aEwLEuvx08bzcy6tOUuawAOncPnxz/3siRtd8hiQ32G1y8VA==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.0.tgz} cpu: [arm] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm-musleabihf@4.20.0': - resolution: {integrity: sha512-1asSTl4HKuIHIB1GcdFHNNZhxAYEdqML/MW4QmPS4G0ivbEcBr1JKlFLKsIRqjSwOBkdItn3/ZDlyvZ/N6KPlw==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.20.0.tgz} + '@rollup/rollup-linux-arm-musleabihf@4.21.0': + resolution: {integrity: sha512-efRIANsz3UHZrnZXuEvxS9LoCOWMGD1rweciD6uJQIx2myN3a8Im1FafZBzh7zk1RJ6oKcR16dU3UPldaKd83w==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.0.tgz} cpu: [arm] os: [linux] libc: [musl] - '@rollup/rollup-linux-arm64-gnu@4.20.0': - resolution: {integrity: sha512-COBb8Bkx56KldOYJfMf6wKeYJrtJ9vEgBRAOkfw6Ens0tnmzPqvlpjZiLgkhg6cA3DGzCmLmmd319pmHvKWWlQ==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.20.0.tgz} + '@rollup/rollup-linux-arm64-gnu@4.21.0': + resolution: {integrity: sha512-ZrPhydkTVhyeGTW94WJ8pnl1uroqVHM3j3hjdquwAcWnmivjAwOYjTEAuEDeJvGX7xv3Z9GAvrBkEzCgHq9U1w==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.0.tgz} cpu: [arm64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.20.0': - resolution: {integrity: sha512-+it+mBSyMslVQa8wSPvBx53fYuZK/oLTu5RJoXogjk6x7Q7sz1GNRsXWjn6SwyJm8E/oMjNVwPhmNdIjwP135Q==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.20.0.tgz} + '@rollup/rollup-linux-arm64-musl@4.21.0': + resolution: {integrity: sha512-cfaupqd+UEFeURmqNP2eEvXqgbSox/LHOyN9/d2pSdV8xTrjdg3NgOFJCtc1vQ/jEke1qD0IejbBfxleBPHnPw==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.0.tgz} cpu: [arm64] os: [linux] libc: [musl] - '@rollup/rollup-linux-powerpc64le-gnu@4.20.0': - resolution: {integrity: sha512-yAMvqhPfGKsAxHN8I4+jE0CpLWD8cv4z7CK7BMmhjDuz606Q2tFKkWRY8bHR9JQXYcoLfopo5TTqzxgPUjUMfw==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.20.0.tgz} + '@rollup/rollup-linux-powerpc64le-gnu@4.21.0': + resolution: {integrity: sha512-ZKPan1/RvAhrUylwBXC9t7B2hXdpb/ufeu22pG2psV7RN8roOfGurEghw1ySmX/CmDDHNTDDjY3lo9hRlgtaHg==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.0.tgz} cpu: [ppc64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-gnu@4.20.0': - resolution: {integrity: sha512-qmuxFpfmi/2SUkAw95TtNq/w/I7Gpjurx609OOOV7U4vhvUhBcftcmXwl3rqAek+ADBwSjIC4IVNLiszoj3dPA==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.20.0.tgz} + '@rollup/rollup-linux-riscv64-gnu@4.21.0': + resolution: {integrity: sha512-H1eRaCwd5E8eS8leiS+o/NqMdljkcb1d6r2h4fKSsCXQilLKArq6WS7XBLDu80Yz+nMqHVFDquwcVrQmGr28rg==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.0.tgz} cpu: [riscv64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-s390x-gnu@4.20.0': - resolution: {integrity: sha512-I0BtGXddHSHjV1mqTNkgUZLnS3WtsqebAXv11D5BZE/gfw5KoyXSAXVqyJximQXNvNzUo4GKlCK/dIwXlz+jlg==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.20.0.tgz} + '@rollup/rollup-linux-s390x-gnu@4.21.0': + resolution: {integrity: sha512-zJ4hA+3b5tu8u7L58CCSI0A9N1vkfwPhWd/puGXwtZlsB5bTkwDNW/+JCU84+3QYmKpLi+XvHdmrlwUwDA6kqw==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.0.tgz} cpu: [s390x] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.20.0': - resolution: {integrity: sha512-y+eoL2I3iphUg9tN9GB6ku1FA8kOfmF4oUEWhztDJ4KXJy1agk/9+pejOuZkNFhRwHAOxMsBPLbXPd6mJiCwew==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.20.0.tgz} + '@rollup/rollup-linux-x64-gnu@4.21.0': + resolution: {integrity: sha512-e2hrvElFIh6kW/UNBQK/kzqMNY5mO+67YtEh9OA65RM5IJXYTWiXjX6fjIiPaqOkBthYF1EqgiZ6OXKcQsM0hg==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.0.tgz} cpu: [x64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.20.0': - resolution: {integrity: sha512-hM3nhW40kBNYUkZb/r9k2FKK+/MnKglX7UYd4ZUy5DJs8/sMsIbqWK2piZtVGE3kcXVNj3B2IrUYROJMMCikNg==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.20.0.tgz} + '@rollup/rollup-linux-x64-musl@4.21.0': + resolution: {integrity: sha512-1vvmgDdUSebVGXWX2lIcgRebqfQSff0hMEkLJyakQ9JQUbLDkEaMsPTLOmyccyC6IJ/l3FZuJbmrBw/u0A0uCQ==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.0.tgz} cpu: [x64] os: [linux] libc: [musl] - '@rollup/rollup-win32-arm64-msvc@4.20.0': - resolution: {integrity: sha512-psegMvP+Ik/Bg7QRJbv8w8PAytPA7Uo8fpFjXyCRHWm6Nt42L+JtoqH8eDQ5hRP7/XW2UiIriy1Z46jf0Oa1kA==, tarball: https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.20.0.tgz} + '@rollup/rollup-win32-arm64-msvc@4.21.0': + resolution: {integrity: sha512-s5oFkZ/hFcrlAyBTONFY1TWndfyre1wOMwU+6KCpm/iatybvrRgmZVM+vCFwxmC5ZhdlgfE0N4XorsDpi7/4XQ==, tarball: https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.0.tgz} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.20.0': - resolution: {integrity: sha512-GabekH3w4lgAJpVxkk7hUzUf2hICSQO0a/BLFA11/RMxQT92MabKAqyubzDZmMOC/hcJNlc+rrypzNzYl4Dx7A==, tarball: https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.20.0.tgz} + '@rollup/rollup-win32-ia32-msvc@4.21.0': + resolution: {integrity: sha512-G9+TEqRnAA6nbpqyUqgTiopmnfgnMkR3kMukFBDsiyy23LZvUCpiUwjTRx6ezYCjJODXrh52rBR9oXvm+Fp5wg==, tarball: https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.0.tgz} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.20.0': - resolution: {integrity: sha512-aJ1EJSuTdGnM6qbVC4B5DSmozPTqIag9fSzXRNNo+humQLG89XpPgdt16Ia56ORD7s+H8Pmyx44uczDQ0yDzpg==, tarball: https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.20.0.tgz} + '@rollup/rollup-win32-x64-msvc@4.21.0': + resolution: {integrity: sha512-2jsCDZwtQvRhejHLfZ1JY6w6kEuEtfF9nzYsZxzSlNVKDX+DpsDJ+Rbjkm74nvg2rdx0gwBS+IMdvwJuq3S9pQ==, tarball: https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.0.tgz} cpu: [x64] os: [win32] @@ -849,7 +855,7 @@ packages: resolution: {integrity: sha512-sqgsT69YFeLWf5NtJ4Xq/xAF8p4ZQHlmGW74Nu2tD4+g5fAsposc4ZfaaPixVu4y01BEiDCWLRDCvDM5JOsRxg==} '@types/estree@1.0.5': - resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==, tarball: https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz} '@types/jsdom@21.1.7': resolution: {integrity: sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==} @@ -2385,6 +2391,9 @@ packages: typescript: optional: true + pinyin-pro@3.24.2: + resolution: {integrity: sha512-5tPyLhxT4CZ9dWqQRqm3X5ADdS18Sb2w0ranNBgr6jCrqO4O8gtfuyqG7Y6+1Mre+0n2VlhKDz+3P5oqSLrkOw==, tarball: https://registry.npmjs.org/pinyin-pro/-/pinyin-pro-3.24.2.tgz} + pkg-types@1.1.3: resolution: {integrity: sha512-+JrgthZG6m3ckicaOB74TwQ+tBWsFl3qVQg7mN8ulwSOElJ7gBhKzj2VkCPnZ4NlF6kEquYU+RIYNVAvzd54UA==} @@ -2484,8 +2493,8 @@ packages: peerDependencies: rollup: ^2.25.0 || ^3.3.0 || ^4.1.4 - rollup@4.20.0: - resolution: {integrity: sha512-6rbWBChcnSGzIlXeIdNIZTopKYad8ZG8ajhl78lGRLsI2rX8IkaotQhVas2Ma+GPxJav19wrSzvRvuiv0YKzWw==} + rollup@4.21.0: + resolution: {integrity: sha512-vo+S/lfA2lMS7rZ2Qoubi6I5hwZwzXeUIctILZLbHI+laNtvhhOIon2S1JksA5UEDQ7l3vberd0fxK44lTYjbQ==, tarball: https://registry.npmjs.org/rollup/-/rollup-4.21.0.tgz} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3592,60 +3601,60 @@ snapshots: '@polka/url@1.0.0-next.25': {} - '@rollup/pluginutils@5.1.0(rollup@4.20.0)': + '@rollup/pluginutils@5.1.0(rollup@4.21.0)': dependencies: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: - rollup: 4.20.0 + rollup: 4.21.0 - '@rollup/rollup-android-arm-eabi@4.20.0': + '@rollup/rollup-android-arm-eabi@4.21.0': optional: true - '@rollup/rollup-android-arm64@4.20.0': + '@rollup/rollup-android-arm64@4.21.0': optional: true - '@rollup/rollup-darwin-arm64@4.20.0': + '@rollup/rollup-darwin-arm64@4.21.0': optional: true - '@rollup/rollup-darwin-x64@4.20.0': + '@rollup/rollup-darwin-x64@4.21.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.20.0': + '@rollup/rollup-linux-arm-gnueabihf@4.21.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.20.0': + '@rollup/rollup-linux-arm-musleabihf@4.21.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.20.0': + '@rollup/rollup-linux-arm64-gnu@4.21.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.20.0': + '@rollup/rollup-linux-arm64-musl@4.21.0': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.20.0': + '@rollup/rollup-linux-powerpc64le-gnu@4.21.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.20.0': + '@rollup/rollup-linux-riscv64-gnu@4.21.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.20.0': + '@rollup/rollup-linux-s390x-gnu@4.21.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.20.0': + '@rollup/rollup-linux-x64-gnu@4.21.0': optional: true - '@rollup/rollup-linux-x64-musl@4.20.0': + '@rollup/rollup-linux-x64-musl@4.21.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.20.0': + '@rollup/rollup-win32-arm64-msvc@4.21.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.20.0': + '@rollup/rollup-win32-ia32-msvc@4.21.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.20.0': + '@rollup/rollup-win32-x64-msvc@4.21.0': optional: true '@rushstack/eslint-patch@1.10.4': {} @@ -3784,21 +3793,21 @@ snapshots: unhead: 1.10.0 vue: 3.4.37(typescript@5.5.4) - '@unocss/astro@0.62.1(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0))': + '@unocss/astro@0.62.1(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0))': dependencies: '@unocss/core': 0.62.1 '@unocss/reset': 0.62.1 - '@unocss/vite': 0.62.1(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) + '@unocss/vite': 0.62.1(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) optionalDependencies: vite: 5.4.0(@types/node@22.2.0)(less@4.2.0) transitivePeerDependencies: - rollup - supports-color - '@unocss/cli@0.62.1(rollup@4.20.0)': + '@unocss/cli@0.62.1(rollup@4.21.0)': dependencies: '@ampproject/remapping': 2.3.0 - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) '@unocss/config': 0.62.1 '@unocss/core': 0.62.1 '@unocss/preset-uno': 0.62.1 @@ -3931,10 +3940,10 @@ snapshots: dependencies: '@unocss/core': 0.62.1 - '@unocss/vite@0.62.1(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0))': + '@unocss/vite@0.62.1(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0))': dependencies: '@ampproject/remapping': 2.3.0 - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) '@unocss/config': 0.62.1 '@unocss/core': 0.62.1 '@unocss/inspector': 0.62.1 @@ -4022,10 +4031,10 @@ snapshots: path-browserify: 1.0.1 vscode-uri: 3.0.8 - '@vue-macros/common@1.12.2(rollup@4.20.0)(vue@3.4.37(typescript@5.5.4))': + '@vue-macros/common@1.12.2(rollup@4.21.0)(vue@3.4.37(typescript@5.5.4))': dependencies: '@babel/types': 7.25.2 - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) '@vue/compiler-sfc': 3.4.37 ast-kit: 1.0.1 local-pkg: 0.5.0 @@ -5404,6 +5413,8 @@ snapshots: optionalDependencies: typescript: 5.5.4 + pinyin-pro@3.24.2: {} + pkg-types@1.1.3: dependencies: confbox: 0.1.7 @@ -5480,34 +5491,34 @@ snapshots: dependencies: glob: 7.2.3 - rollup-plugin-external-globals@0.10.0(rollup@4.20.0): + rollup-plugin-external-globals@0.10.0(rollup@4.21.0): dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) estree-walker: 3.0.3 is-reference: 3.0.2 magic-string: 0.30.11 - rollup: 4.20.0 + rollup: 4.21.0 - rollup@4.20.0: + rollup@4.21.0: dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.20.0 - '@rollup/rollup-android-arm64': 4.20.0 - '@rollup/rollup-darwin-arm64': 4.20.0 - '@rollup/rollup-darwin-x64': 4.20.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.20.0 - '@rollup/rollup-linux-arm-musleabihf': 4.20.0 - '@rollup/rollup-linux-arm64-gnu': 4.20.0 - '@rollup/rollup-linux-arm64-musl': 4.20.0 - '@rollup/rollup-linux-powerpc64le-gnu': 4.20.0 - '@rollup/rollup-linux-riscv64-gnu': 4.20.0 - '@rollup/rollup-linux-s390x-gnu': 4.20.0 - '@rollup/rollup-linux-x64-gnu': 4.20.0 - '@rollup/rollup-linux-x64-musl': 4.20.0 - '@rollup/rollup-win32-arm64-msvc': 4.20.0 - '@rollup/rollup-win32-ia32-msvc': 4.20.0 - '@rollup/rollup-win32-x64-msvc': 4.20.0 + '@rollup/rollup-android-arm-eabi': 4.21.0 + '@rollup/rollup-android-arm64': 4.21.0 + '@rollup/rollup-darwin-arm64': 4.21.0 + '@rollup/rollup-darwin-x64': 4.21.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.21.0 + '@rollup/rollup-linux-arm-musleabihf': 4.21.0 + '@rollup/rollup-linux-arm64-gnu': 4.21.0 + '@rollup/rollup-linux-arm64-musl': 4.21.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.21.0 + '@rollup/rollup-linux-riscv64-gnu': 4.21.0 + '@rollup/rollup-linux-s390x-gnu': 4.21.0 + '@rollup/rollup-linux-x64-gnu': 4.21.0 + '@rollup/rollup-linux-x64-musl': 4.21.0 + '@rollup/rollup-win32-arm64-msvc': 4.21.0 + '@rollup/rollup-win32-ia32-msvc': 4.21.0 + '@rollup/rollup-win32-x64-msvc': 4.21.0 fsevents: 2.3.3 rrweb-cssom@0.6.0: {} @@ -5747,9 +5758,9 @@ snapshots: '@unhead/shared': 1.10.0 hookable: 5.5.3 - unimport@3.10.0(rollup@4.20.0): + unimport@3.10.0(rollup@4.21.0): dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) acorn: 8.12.1 escape-string-regexp: 5.0.0 estree-walker: 3.0.3 @@ -5769,10 +5780,10 @@ snapshots: universalify@2.0.1: {} - unocss@0.62.1(postcss@8.4.41)(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)): + unocss@0.62.1(postcss@8.4.41)(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)): dependencies: - '@unocss/astro': 0.62.1(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) - '@unocss/cli': 0.62.1(rollup@4.20.0) + '@unocss/astro': 0.62.1(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) + '@unocss/cli': 0.62.1(rollup@4.21.0) '@unocss/core': 0.62.1 '@unocss/extractor-arbitrary-variants': 0.62.1 '@unocss/postcss': 0.62.1(postcss@8.4.41) @@ -5790,7 +5801,7 @@ snapshots: '@unocss/transformer-compile-class': 0.62.1 '@unocss/transformer-directives': 0.62.1 '@unocss/transformer-variant-group': 0.62.1 - '@unocss/vite': 0.62.1(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) + '@unocss/vite': 0.62.1(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) optionalDependencies: vite: 5.4.0(@types/node@22.2.0)(less@4.2.0) transitivePeerDependencies: @@ -5798,25 +5809,25 @@ snapshots: - rollup - supports-color - unplugin-auto-import@0.18.2(@vueuse/core@10.7.0(vue@3.4.37(typescript@5.5.4)))(rollup@4.20.0): + unplugin-auto-import@0.18.2(@vueuse/core@10.7.0(vue@3.4.37(typescript@5.5.4)))(rollup@4.21.0): dependencies: '@antfu/utils': 0.7.10 - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) fast-glob: 3.3.2 local-pkg: 0.5.0 magic-string: 0.30.11 minimatch: 9.0.5 - unimport: 3.10.0(rollup@4.20.0) + unimport: 3.10.0(rollup@4.21.0) unplugin: 1.12.1 optionalDependencies: '@vueuse/core': 10.7.0(vue@3.4.37(typescript@5.5.4)) transitivePeerDependencies: - rollup - unplugin-vue-components@0.27.4(@babel/parser@7.25.3)(rollup@4.20.0)(vue@3.4.37(typescript@5.5.4)): + unplugin-vue-components@0.27.4(@babel/parser@7.25.3)(rollup@4.21.0)(vue@3.4.37(typescript@5.5.4)): dependencies: '@antfu/utils': 0.7.10 - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) chokidar: 3.6.0 debug: 4.3.6 fast-glob: 3.3.2 @@ -5832,12 +5843,12 @@ snapshots: - rollup - supports-color - unplugin-vue-markdown@0.26.2(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)): + unplugin-vue-markdown@0.26.2(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)): dependencies: '@mdit-vue/plugin-component': 2.1.3 '@mdit-vue/plugin-frontmatter': 2.1.3 '@mdit-vue/types': 2.1.0 - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) '@types/markdown-it': 14.1.2 markdown-it: 14.1.0 unplugin: 1.12.1 @@ -5845,11 +5856,11 @@ snapshots: transitivePeerDependencies: - rollup - unplugin-vue-router@0.10.3(rollup@4.20.0)(vue-router@4.4.3(patch_hash=srtmpgmwmi3z5x3wdppdguh7mi)(vue@3.4.37(typescript@5.5.4)))(vue@3.4.37(typescript@5.5.4)): + unplugin-vue-router@0.10.3(rollup@4.21.0)(vue-router@4.4.3(patch_hash=srtmpgmwmi3z5x3wdppdguh7mi)(vue@3.4.37(typescript@5.5.4)))(vue@3.4.37(typescript@5.5.4)): dependencies: '@babel/types': 7.25.2 - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) - '@vue-macros/common': 1.12.2(rollup@4.20.0)(vue@3.4.37(typescript@5.5.4)) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) + '@vue-macros/common': 1.12.2(rollup@4.21.0)(vue@3.4.37(typescript@5.5.4)) ast-walker-scope: 0.6.2 chokidar: 3.6.0 fast-glob: 3.3.2 @@ -5923,9 +5934,9 @@ snapshots: - supports-color - terser - vite-plugin-cdn-import@1.0.1(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)): + vite-plugin-cdn-import@1.0.1(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)): dependencies: - rollup-plugin-external-globals: 0.10.0(rollup@4.20.0) + rollup-plugin-external-globals: 0.10.0(rollup@4.21.0) vite-plugin-externals: 0.6.2(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) transitivePeerDependencies: - rollup @@ -5939,10 +5950,10 @@ snapshots: magic-string: 0.25.9 vite: 5.4.0(@types/node@22.2.0)(less@4.2.0) - vite-plugin-inspect@0.8.5(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)): + vite-plugin-inspect@0.8.5(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)): dependencies: '@antfu/utils': 0.7.10 - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) debug: 4.3.6 error-stack-parser-es: 0.1.5 fs-extra: 11.2.0 @@ -5955,7 +5966,7 @@ snapshots: - rollup - supports-color - vite-plugin-vue-devtools@7.3.8(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0))(vue@3.4.37(typescript@5.5.4)): + vite-plugin-vue-devtools@7.3.8(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0))(vue@3.4.37(typescript@5.5.4)): dependencies: '@vue/devtools-core': 7.3.8(vite@5.4.0(@types/node@22.2.0)(less@4.2.0))(vue@3.4.37(typescript@5.5.4)) '@vue/devtools-kit': 7.3.8 @@ -5963,7 +5974,7 @@ snapshots: execa: 8.0.1 sirv: 2.0.4 vite: 5.4.0(@types/node@22.2.0)(less@4.2.0) - vite-plugin-inspect: 0.8.5(rollup@4.20.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) + vite-plugin-inspect: 0.8.5(rollup@4.21.0)(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) vite-plugin-vue-inspector: 5.1.3(vite@5.4.0(@types/node@22.2.0)(less@4.2.0)) transitivePeerDependencies: - '@nuxt/kit' @@ -5990,7 +6001,7 @@ snapshots: dependencies: esbuild: 0.21.5 postcss: 8.4.41 - rollup: 4.20.0 + rollup: 4.21.0 optionalDependencies: '@types/node': 22.2.0 fsevents: 2.3.3 diff --git a/vite.config.ts b/vite.config.ts index 6420c6e..3792a29 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,11 @@ +import { unheadVueComposablesImports } from '@unhead/vue'; import { VantResolver } from '@vant/auto-import-resolver'; import Vue from '@vitejs/plugin-vue'; import vueJsx from '@vitejs/plugin-vue-jsx'; +import path from 'node:path'; import { fileURLToPath, URL } from 'node:url'; +import { pinyin } from 'pinyin-pro'; +import type { GetManualChunk } from 'rollup'; import UnoCSS from 'unocss/vite'; import AutoImport from 'unplugin-auto-import/vite'; import { TDesignResolver } from 'unplugin-vue-components/resolvers'; @@ -12,7 +16,6 @@ import VueRouter from 'unplugin-vue-router/vite'; import { defineConfig, loadEnv } from 'vite'; import cdnImport from 'vite-plugin-cdn-import'; import vueDevTools from 'vite-plugin-vue-devtools'; -import { unheadVueComposablesImports } from '@unhead/vue'; // https://vitejs.dev/config/ export default defineConfig(({ mode, command }) => { @@ -88,23 +91,39 @@ export default defineConfig(({ mode, command }) => { // chunkFileNames: 'assets/chunk/[name]_[hash].js', // entryFileNames: 'assets/entry/[name]_[hash].js', // assetFileNames: 'assets/[ext]/[name]_[hash].[ext]', - manualChunks: (id /* , { getModuleIds, getModuleInfo } */) => { - if (id.includes('node_modules') && env.VITE_SPLIT_CHUNKS === 'true') { - let pkgName = id; - pkgName = pkgName.split('.pnpm/')?.[1] || pkgName; - pkgName = pkgName.split('node_modules/')?.[1] || pkgName; - pkgName = pkgName.startsWith('@') - ? pkgName.split('/')[0] + '/' + pkgName.split('/')[1] - : pkgName.split('/')[0]; - - if (pkgName.startsWith('@vue/') /* || pkgName === 'vue-demi' */) pkgName = 'vue'; - /* if (pkgName.includes('vue-router')) pkgName = 'vue-router'; */ - - return `libs/${pkgName}`; - } - }, + manualChunks: env.VITE_SPLIT_CHUNKS ? createSplitChunk() : undefined, }, }, }, }; }); + +// packages/vite/src/node/plugins/splitVendorChunk.ts +function createSplitChunk(): GetManualChunk { + return (id /* , { getModuleIds, getModuleInfo } */) => { + if (isInNodeModules(id) /* && !isCSSRequest(id) */) { + let pkgName = id; + pkgName = pkgName.split('.pnpm/')?.[1] || pkgName; + pkgName = pkgName.split('node_modules/')?.[1] || pkgName; + pkgName = pkgName.startsWith('@') ? pkgName.split('/')[0] + '/' + pkgName.split('/')[1] : pkgName.split('/')[0]; + + if (pkgName.startsWith('@vue/') /* || pkgName === 'vue-demi' */) pkgName = 'vue'; + /* if (pkgName.includes('vue-router')) pkgName = 'vue-router'; */ + + return `libs/${pkgName}`; + } else if (id.includes('src/pages')) { + let fileName = path + .basename(id) + .split('?')[0] + .replace(/\.\w+$/, ''); + fileName = pinyin(fileName, { type: 'array' }).join(''); + return `pages/${fileName}`; + } + }; +} + +function isInNodeModules(id: string): boolean { + return id.includes('node_modules'); +} +/* const CSS_LANGS_RE = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/; +const isCSSRequest = (request: string): boolean => CSS_LANGS_RE.test(request); */