diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 4735b086..9fe926ed 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -137,6 +137,7 @@ export default defineConfig({ pt: { label: 'Português', link: 'https://pt.vite.dev' }, ko: { label: '한국어', link: 'https://ko.vite.dev' }, de: { label: 'Deutsch', link: 'https://de.vite.dev' }, + fa: { label: 'فارسی', link: 'https://fa.vite.dev' }, }, themeConfig: { diff --git a/changes/this-environment-in-hooks.md b/changes/this-environment-in-hooks.md index 9a085560..f89bdfd4 100644 --- a/changes/this-environment-in-hooks.md +++ b/changes/this-environment-in-hooks.md @@ -18,7 +18,7 @@ ## 迁移指南 {#migration-guide} -对于现有的插件,如果想要快速迁移,可以在 `resolveId`、`load` 和 `transform` 钩子中,将 `options.ssr` 参数替换为 `this.environment.name !== 'client'`: +对于现有的插件,如果想要快速迁移,可以在 `resolveId`、`load` 和 `transform` 钩子中,将 `options.ssr` 参数替换为 `this.environment.config.consumer === 'server'`: ```ts import { Plugin } from 'vite' @@ -28,7 +28,7 @@ export function myPlugin(): Plugin { name: 'my-plugin', resolveId(id, importer, options) { const isSSR = options.ssr // [!code --] - const isSSR = this.environment.name !== 'client' // [!code ++] + const isSSR = this.environment.config.consumer === 'server' // [!code ++] if (isSSR) { // SSR 特有逻辑 diff --git a/package.json b/package.json index 4626a743..fb5e1ff0 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,10 @@ "devDependencies": { "@shikijs/vitepress-twoslash": "^2.5.0", "@types/express": "^5.0.1", - "feed": "^4.2.2", + "feed": "^5.0.1", "vitepress": "^1.6.3", "vitepress-plugin-group-icons": "^1.5.2", - "vitepress-plugin-llms": "^1.1.0", + "vitepress-plugin-llms": "^1.1.4", "vue": "^3.5.13", "@types/node": "^20.9.2", "@type-challenges/utils": "^0.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d43342e3..ab0ccb52 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,8 +24,8 @@ importers: specifier: ^4.1.2 version: 4.1.2 feed: - specifier: ^4.2.2 - version: 4.2.2 + specifier: ^5.0.1 + version: 5.0.1 gray-matter: specifier: ^4.0.3 version: 4.0.3 @@ -45,8 +45,8 @@ importers: specifier: ^1.5.2 version: 1.5.2 vitepress-plugin-llms: - specifier: ^1.1.0 - version: 1.1.0 + specifier: ^1.1.4 + version: 1.1.4 vue: specifier: ^3.5.13 version: 3.5.13(typescript@5.4.5) @@ -1092,9 +1092,9 @@ packages: picomatch: optional: true - feed@4.2.2: - resolution: {integrity: sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ==} - engines: {node: '>=0.4.0'} + feed@5.0.1: + resolution: {integrity: sha512-kOveKLHucVZ6RI91bdWAts9O0L1N2mGzRGVCDQPRnHh4HmgqLdN66Cp/5dMeJZGn/qnBslWliwX37FEBq8DCIA==} + engines: {node: '>=20', pnpm: '>=10'} floating-vue@5.2.2: resolution: {integrity: sha512-afW+h2CFafo+7Y9Lvw/xsqjaQlKLdJV7h1fCHfcYQ1C4SVMlu7OAekqWgu5d4SgvkBVU0pVpLlVsrSTBURFRkg==} @@ -1678,8 +1678,8 @@ packages: vitepress-plugin-group-icons@1.5.2: resolution: {integrity: sha512-zen07KxZ83y3eecou4EraaEgwIriwHaB5Q0cHAmS4yO1UZEQvbljTylHPqiJ7LNkV39U8VehfcyquAJXg/26LA==} - vitepress-plugin-llms@1.1.0: - resolution: {integrity: sha512-nb7bG/lBDihlcFTzqxRxQIyzeBWQW9F6OwuUWQ7PFUNK5kVbybxXGISU4wvAV8osQmfrD9xNIGJQfuOLj5CzHg==} + vitepress-plugin-llms@1.1.4: + resolution: {integrity: sha512-/+xrVWpd03B5bGsWN+R+TN0P3kqM/jaDWiddmpFxPuw7vJdoE9mAqAZx1ywzhHEeBCepDMt069l1VRyitmEU6A==} vitepress@1.6.3: resolution: {integrity: sha512-fCkfdOk8yRZT8GD9BFqusW3+GggWYZ/rYncOfmgcDtP3ualNHCAg+Robxp2/6xfH1WwPHtGpPwv7mbA3qomtBw==} @@ -2707,7 +2707,7 @@ snapshots: optionalDependencies: picomatch: 4.0.2 - feed@4.2.2: + feed@5.0.1: dependencies: xml-js: 1.6.11 @@ -3456,7 +3456,7 @@ snapshots: transitivePeerDependencies: - supports-color - vitepress-plugin-llms@1.1.0: + vitepress-plugin-llms@1.1.4: dependencies: byte-size: 9.0.1 gray-matter: 4.0.3