From cf250bbfab5e509ac9416cec0b8021e65d0e58fe Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Wed, 5 Nov 2025 10:35:34 +0800 Subject: [PATCH 1/6] docs: update version nav item (#21055) --- .vitepress/config.ts | 87 +++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 45 deletions(-) diff --git a/.vitepress/config.ts b/.vitepress/config.ts index bc9f1aff..2c0dd212 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -10,8 +10,12 @@ import { import llmstxt from 'vitepress-plugin-llms' import type { PluginOption } from 'vite' import { markdownItImageSize } from 'markdown-it-image-size' +import packageJson from '../../packages/vite/package.json' with { type: 'json' } import { buildEnd } from './buildEnd.config' +const viteVersion = packageJson.version +const viteMajorVersion = +viteVersion.split('.')[0] + const ogDescription = 'Next Generation Frontend Tooling' const ogImage = 'https://vite.dev/og-image.jpg' const ogTitle = 'Vite' @@ -42,42 +46,31 @@ const additionalTitle = ((): string => { } })() const versionLinks = ((): DefaultTheme.NavItemWithLink[] => { - const oldVersions: DefaultTheme.NavItemWithLink[] = [ - { - text: 'Vite 6 Docs', - link: 'https://v6.vite.dev', - }, - { - text: 'Vite 5 Docs', - link: 'https://v5.vite.dev', - }, - { - text: 'Vite 4 Docs', - link: 'https://v4.vite.dev', - }, - { - text: 'Vite 3 Docs', - link: 'https://v3.vite.dev', - }, - { - text: 'Vite 2 Docs', - link: 'https://v2.vite.dev', - }, - ] + const links: DefaultTheme.NavItemWithLink[] = [] - switch (deployType) { - case 'main': - case 'local': - return [ - { - text: 'Vite 7 Docs (release)', - link: 'https://vite.dev', - }, - ...oldVersions, - ] - case 'release': - return oldVersions + if (deployType !== 'main') { + links.push({ + text: 'Unreleased Docs', + link: 'https://main.vite.dev', + }) + } + + if (deployType === 'main' || deployType === 'local') { + links.push({ + text: `Vite ${viteMajorVersion} Docs (release)`, + link: 'https://vite.dev', + }) } + + // Create version links from v2 onwards + for (let i = viteMajorVersion - 1; i >= 2; i--) { + links.push({ + text: `Vite ${i} Docs`, + link: `https://v${i}.vite.dev`, + }) + } + + return links })() function inlineScript(file: string): HeadConfig { @@ -237,21 +230,25 @@ export default defineConfig({ text: 'DEV Community', link: 'https://dev.to/t/vite', }, - { - text: 'Changelog', - link: 'https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md', - }, - { - text: 'Contributing', - link: 'https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md', - }, ], }, ], }, { - text: 'Version', - items: versionLinks, + text: `v${viteVersion}`, + items: [ + { + text: 'Changelog', + link: 'https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md', + }, + { + text: 'Contributing', + link: 'https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md', + }, + { + items: versionLinks, + }, + ], }, ], @@ -330,7 +327,7 @@ export default defineConfig({ link: '/guide/rolldown', }, { - text: 'Migration from v6', + text: `Migration from v${viteMajorVersion - 1}`, link: '/guide/migration', }, { From 48231ac336ef6bbb9845298e530159893fb5c9e7 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Wed, 5 Nov 2025 15:29:02 +0800 Subject: [PATCH 2/6] docs: add links to releases docs (#21062) --- guide/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/guide/index.md b/guide/index.md index de7376bf..029a47e0 100644 --- a/guide/index.md +++ b/guide/index.md @@ -259,6 +259,8 @@ pnpm link --global # use your preferred package manager for this step Then go to your Vite based project and run `pnpm link --global vite` (or the package manager that you used to link `vite` globally). Now restart the development server to ride on the bleeding edge! +To learn more about how and when Vite does releases, check out the [Releases](../releases.md) documentation. + ::: tip Dependencies using Vite To replace the Vite version used by dependencies transitively, you should use [npm overrides](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#overrides) or [pnpm overrides](https://pnpm.io/9.x/package_json#pnpmoverrides). ::: From c82b4a8cd4f1c3d549b9a0b5948b8f607f606dad Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Wed, 5 Nov 2025 16:11:20 +0800 Subject: [PATCH 3/6] docs(release): update supported versions wording (#21061) --- .vitepress/config.ts | 3 + .../theme/components/SupportedVersions.vue | 159 ++++++++++++++++++ releases.md | 21 ++- 3 files changed, 175 insertions(+), 8 deletions(-) create mode 100644 .vitepress/theme/components/SupportedVersions.vue diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 2c0dd212..08f585c3 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -529,6 +529,9 @@ In addition, Vite is highly extensible via its [Plugin API](https://vite.dev/gui 'gsap/dist/MotionPathPlugin', ], }, + define: { + __VITE_VERSION__: JSON.stringify(viteVersion), + }, }, buildEnd, }) diff --git a/.vitepress/theme/components/SupportedVersions.vue b/.vitepress/theme/components/SupportedVersions.vue new file mode 100644 index 00000000..b2530ee4 --- /dev/null +++ b/.vitepress/theme/components/SupportedVersions.vue @@ -0,0 +1,159 @@ + + + + + diff --git a/releases.md b/releases.md index b30e513d..14e81380 100644 --- a/releases.md +++ b/releases.md @@ -1,3 +1,7 @@ + + # Releases Vite releases follow [Semantic Versioning](https://semver.org/). You can see the latest stable version of Vite in the [Vite npm package page](https://www.npmjs.com/package/vite). @@ -12,20 +16,21 @@ Vite does not have a fixed release cycle. - **Minor** releases always contain new features and are released as needed. Minor releases always have a beta pre-release phase (usually every two months). - **Major** releases generally align with [Node.js EOL schedule](https://endoflife.date/nodejs), and will be announced ahead of time. These releases will go through long-term discussions with the ecosystem, and have alpha and beta pre-release phases (usually every year). -The Vite version ranges that are supported by the Vite team are automatically determined by: +## Supported Versions + +In summary, the current supported Vite versions are: + + + +
+ +The supported version ranges are are automatically determined by: - **Current Minor** gets regular fixes. - **Previous Major** (only for its latest minor) and **Previous Minor** receives important fixes and security patches. - **Second-to-last Major** (only for its latest minor) and **Second-to-last Minor** receives security patches. - All versions before these are no longer supported. -As an example, if the Vite latest is at 5.3.10: - -- Regular patches are released for `vite@5.3`. -- Important fixes and security patches are backported to `vite@4` and `vite@5.2`. -- Security patches are also backported to `vite@3`, and `vite@5.1`. -- `vite@2` and `vite@5.0` are no longer supported. Users should upgrade to receive updates. - We recommend updating Vite regularly. Check out the [Migration Guides](https://vite.dev/guide/migration.html) when you update to each Major. The Vite team works closely with the main projects in the ecosystem to ensure the quality of new versions. We test new Vite versions before releasing them through the [vite-ecosystem-ci project](https://github.com/vitejs/vite-ecosystem-ci). Most projects using Vite should be able to quickly offer support or migrate to new versions as soon as they are released. ## Semantic Versioning Edge Cases From 40bdd86a7f76fe6a3cdc3816a4a059c548b22eee Mon Sep 17 00:00:00 2001 From: waynzh Date: Thu, 6 Nov 2025 10:44:57 +0800 Subject: [PATCH 4/6] docs(cn): resolve conflicts --- .vitepress/config.ts | 274 +++++++-------------- .vitepress/theme/components/ReleaseTag.vue | 37 --- guide/index.md | 9 +- releases.md | 27 +- 4 files changed, 101 insertions(+), 246 deletions(-) delete mode 100644 .vitepress/theme/components/ReleaseTag.vue diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 4088a111..9c4b5ae3 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -5,15 +5,12 @@ import { defineConfig } from 'vitepress' import { transformerTwoslash } from '@shikijs/vitepress-twoslash' import { groupIconMdPlugin, - groupIconVitePlugin, + groupIconVitePlugin } from 'vitepress-plugin-group-icons' -import type { PluginOption } from 'vite' import { markdownItImageSize } from 'markdown-it-image-size' -import packageJson from '../../packages/vite/package.json' with { type: 'json' } import { buildEnd } from './buildEnd.config' -const viteVersion = packageJson.version -const viteMajorVersion = +viteVersion.split('.')[0] +const viteMajorVersion = 7 const ogDescription = 'Next Generation Frontend Tooling' const ogImage = 'https://vite.dev/og-image.jpg' @@ -21,51 +18,16 @@ const ogTitle = 'Vite' const ogUrl = 'https://vite.dev' // netlify envs -const deployURL = process.env.DEPLOY_PRIME_URL || '' const commitRef = process.env.COMMIT_REF?.slice(0, 8) || 'dev' -const deployType = (() => { - switch (deployURL) { - case 'https://main--vite-docs-main.netlify.app': - return 'main' - case '': - return 'local' - default: - return 'release' - } -})() -const additionalTitle = ((): string => { - switch (deployType) { - case 'main': - return ' (main branch)' - case 'local': - return ' (local)' - case 'release': - return '' - } -})() const versionLinks = ((): DefaultTheme.NavItemWithLink[] => { const links: DefaultTheme.NavItemWithLink[] = [] - if (deployType !== 'main') { - links.push({ - text: 'Unreleased Docs', - link: 'https://main.vite.dev', - }) - } - - if (deployType === 'main' || deployType === 'local') { - links.push({ - text: `Vite ${viteMajorVersion} Docs (release)`, - link: 'https://vite.dev', - }) - } - // Create version links from v2 onwards for (let i = viteMajorVersion - 1; i >= 2; i--) { links.push({ text: `Vite ${i} Docs`, - link: `https://v${i}.vite.dev`, + link: `https://v${i}.vite.dev` }) } @@ -78,8 +40,8 @@ function inlineScript(file: string): HeadConfig { {}, fs.readFileSync( path.resolve(__dirname, `./inlined-scripts/${file}`), - 'utf-8', - ), + 'utf-8' + ) ] } @@ -92,7 +54,7 @@ export default defineConfig({ ['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }], [ 'link', - { rel: 'alternate', type: 'application/rss+xml', href: '/blog.rss' }, + { rel: 'alternate', type: 'application/rss+xml', href: '/blog.rss' } ], ['link', { rel: 'preconnect', href: 'https://fonts.googleapis.com' }], [ @@ -100,23 +62,23 @@ export default defineConfig({ { rel: 'preconnect', href: 'https://fonts.gstatic.com', - crossorigin: 'true', - }, + crossorigin: 'true' + } ], [ 'link', { rel: 'preload', href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Manrope:wght@600&family=IBM+Plex+Mono:wght@400&display=swap', - as: 'style', - }, + as: 'style' + } ], [ 'link', { rel: 'stylesheet', - href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Manrope:wght@600&family=IBM+Plex+Mono:wght@400&display=swap', - }, + href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Manrope:wght@600&family=IBM+Plex+Mono:wght@400&display=swap' + } ], inlineScript('banner.js'), ['link', { rel: 'me', href: 'https://m.webtoo.ls/@vite' }], @@ -135,9 +97,9 @@ export default defineConfig({ src: 'https://cdn.usefathom.com/script.js', 'data-site': 'TPLGJZGR', 'data-spa': 'auto', - defer: '', - }, - ], + defer: '' + } + ] ], locales: { @@ -148,7 +110,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' }, + fa: { label: 'فارسی', link: 'https://fa.vite.dev' } }, themeConfig: { @@ -156,12 +118,12 @@ export default defineConfig({ editLink: { pattern: 'https://github.com/vitejs/docs-cn/edit/main/:path', - text: '为此页提供修改建议', + text: '为此页提供修改建议' }, outline: { label: '本页目录', - level: [2, 3], + level: [2, 3] }, socialLinks: [ @@ -169,7 +131,7 @@ export default defineConfig({ { icon: 'mastodon', link: 'https://elk.zone/m.webtoo.ls/@vite' }, { icon: 'x', link: 'https://x.com/vite_js' }, { icon: 'discord', link: 'https://chat.vite.dev' }, - { icon: 'github', link: 'https://github.com/vitejs/vite' }, + { icon: 'github', link: 'https://github.com/vitejs/vite' } ], search: { @@ -184,10 +146,10 @@ export default defineConfig({ footer: { selectText: '选择', navigateText: '切换', - closeText: '关闭', - }, + closeText: '关闭' + } } - }, + } } }, @@ -204,14 +166,10 @@ export default defineConfig({ footer: { message: `Released under the MIT License. (${commitRef})`, - copyright: - 'Copyright © 2019-present VoidZero Inc. & Vite Contributors' + copyright: 'Copyright © 2019-present VoidZero Inc. & Vite Contributors' }, nav: [ - { - component: 'ReleaseTag' - }, { text: '指引', link: '/guide/', activeMatch: '/guide/' }, { text: '配置', link: '/config/', activeMatch: '/config/' }, { text: '插件', link: '/plugins/', activeMatch: '/plugins/' }, @@ -223,25 +181,25 @@ export default defineConfig({ { text: '发布策略', link: '/releases' }, { text: '纪录片', - link: 'https://www.youtube.com/watch?v=bmWQqAKLgT4', + link: 'https://www.youtube.com/watch?v=bmWQqAKLgT4' }, { items: [ { text: 'Bluesky', - link: 'https://bsky.app/profile/vite.dev', + link: 'https://bsky.app/profile/vite.dev' }, { text: 'Mastodon', - link: 'https://elk.zone/m.webtoo.ls/@vite', + link: 'https://elk.zone/m.webtoo.ls/@vite' }, { text: 'X', - link: 'https://x.com/vite_js', + link: 'https://x.com/vite_js' }, { text: 'Discord 聊天室', - link: 'https://chat.vite.dev', + link: 'https://chat.vite.dev' }, { text: 'Awesome Vite', @@ -249,70 +207,32 @@ export default defineConfig({ }, { text: 'ViteConf', - link: 'https://viteconf.org', + link: 'https://viteconf.org' }, { text: 'Dev.to 社区', link: 'https://dev.to/t/vite' - }, -<<<<<<< HEAD - { - text: '更新日志', - link: 'https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md', - }, - { - text: '贡献指南', - link: 'https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md', - }, -======= ->>>>>>> c82b4a8cd4f1c3d549b9a0b5948b8f607f606dad - ], - }, + } + ] + } ] }, { -<<<<<<< HEAD - text: '历史版本', + text: `v${viteMajorVersion}`, items: [ { - text: 'Vite v6 文档(英文)', - link: 'https://v6.vite.dev' - }, - { - text: 'Vite v5 文档(英文)', - link: 'https://v5.vite.dev' - }, - { - text: 'Vite v4 文档(英文)', - link: 'https://v4.vite.dev' + text: '更新日志', + link: 'https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md' }, { - text: 'Vite v3 文档(英文)', - link: 'https://v3.vite.dev' + text: '贡献指南', + link: 'https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md' }, { - text: 'Vite v2 文档(英文)', - link: 'https://v2.vite.dev' - }, + items: versionLinks + } ] } -======= - text: `v${viteVersion}`, - items: [ - { - text: 'Changelog', - link: 'https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md', - }, - { - text: 'Contributing', - link: 'https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md', - }, - { - items: versionLinks, - }, - ], - }, ->>>>>>> c82b4a8cd4f1c3d549b9a0b5948b8f607f606dad ], sidebar: { @@ -322,24 +242,24 @@ export default defineConfig({ items: [ { text: '开始', - link: '/guide/', + link: '/guide/' }, { text: '理念', - link: '/guide/philosophy', + link: '/guide/philosophy' }, { text: '为什么选 Vite', - link: '/guide/why', - }, - ], + link: '/guide/why' + } + ] }, { text: '指引', items: [ { text: '功能', - link: '/guide/features', + link: '/guide/features' }, { text: '命令行接口', @@ -379,29 +299,25 @@ export default defineConfig({ }, { text: '故障排除', - link: '/guide/troubleshooting', + link: '/guide/troubleshooting' }, { text: '性能', - link: '/guide/performance', + link: '/guide/performance' }, { text: 'Rolldown', - link: '/guide/rolldown', + link: '/guide/rolldown' }, { -<<<<<<< HEAD - text: '从 v6 迁移', -======= text: `Migration from v${viteMajorVersion - 1}`, ->>>>>>> c82b4a8cd4f1c3d549b9a0b5948b8f607f606dad - link: '/guide/migration', + link: '/guide/migration' }, { text: '破坏性变更', - link: '/changes/', - }, - ], + link: '/changes/' + } + ] }, { text: 'API', @@ -412,43 +328,43 @@ export default defineConfig({ }, { text: 'HMR API', - link: '/guide/api-hmr', + link: '/guide/api-hmr' }, { text: 'JavaScript API', - link: '/guide/api-javascript', + link: '/guide/api-javascript' }, { text: '配置参考', - link: '/config/', - }, - ], + link: '/config/' + } + ] }, { text: '环境 API', items: [ { text: '介绍', - link: '/guide/api-environment', + link: '/guide/api-environment' }, { text: '环境实例', - link: '/guide/api-environment-instances', + link: '/guide/api-environment-instances' }, { text: '插件', - link: '/guide/api-environment-plugins', + link: '/guide/api-environment-plugins' }, { text: '框架', - link: '/guide/api-environment-frameworks', + link: '/guide/api-environment-frameworks' }, { text: '运行时', - link: '/guide/api-environment-runtimes', - }, - ], - }, + link: '/guide/api-environment-runtimes' + } + ] + } ], '/config/': [ { @@ -484,51 +400,51 @@ export default defineConfig({ }, { text: 'Worker 选项', - link: '/config/worker-options', - }, - ], - }, + link: '/config/worker-options' + } + ] + } ], '/changes/': [ { text: '破坏性变更', - link: '/changes/', + link: '/changes/' }, { text: '现在', - items: [], + items: [] }, { text: '未来', items: [ { text: '钩子函数中的 this.environment', - link: '/changes/this-environment-in-hooks', + link: '/changes/this-environment-in-hooks' }, { text: 'HMR hotUpdate 插件钩子', - link: '/changes/hotupdate-hook', + link: '/changes/hotupdate-hook' }, { text: '迁移到基于环境的API', - link: '/changes/per-environment-apis', + link: '/changes/per-environment-apis' }, { text: '使用 ModuleRunner API 进行服务端渲染', - link: '/changes/ssr-using-modulerunner', + link: '/changes/ssr-using-modulerunner' }, { text: '构建过程中的共享插件', - link: '/changes/shared-plugins-during-build', - }, - ], + link: '/changes/shared-plugins-during-build' + } + ] }, { text: '过去', - items: [], - }, - ], - }, + items: [] + } + ] + } }, transformPageData(pageData) { const canonicalUrl = `${ogUrl}/${pageData.relativePath}` @@ -537,7 +453,7 @@ export default defineConfig({ pageData.frontmatter.head ??= [] pageData.frontmatter.head.unshift( ['link', { rel: 'canonical', href: canonicalUrl }], - ['meta', { property: 'og:title', content: pageData.title }], + ['meta', { property: 'og:title', content: pageData.title }] ) return pageData }, @@ -548,13 +464,13 @@ export default defineConfig({ config(md) { md.use(groupIconMdPlugin, { titleBar: { - includeSnippet: true, - }, + includeSnippet: true + } }) md.use(markdownItImageSize, { - publicDir: path.resolve(import.meta.dirname, '../public'), + publicDir: path.resolve(import.meta.dirname, '../public') }) - }, + } }, vite: { plugins: [ @@ -562,21 +478,21 @@ export default defineConfig({ groupIconVitePlugin({ customIcon: { firebase: 'vscode-icons:file-type-firebase', - '.gitlab-ci.yml': 'vscode-icons:file-type-gitlab', - }, - }), + '.gitlab-ci.yml': 'vscode-icons:file-type-gitlab' + } + }) ], optimizeDeps: { include: [ '@shikijs/vitepress-twoslash/client', 'gsap', 'gsap/dist/ScrollTrigger', - 'gsap/dist/MotionPathPlugin', - ], + 'gsap/dist/MotionPathPlugin' + ] }, define: { - __VITE_VERSION__: JSON.stringify(viteVersion), - }, + __VITE_VERSION__: JSON.stringify(viteMajorVersion) + } }, - buildEnd, + buildEnd }) diff --git a/.vitepress/theme/components/ReleaseTag.vue b/.vitepress/theme/components/ReleaseTag.vue deleted file mode 100644 index c16538ae..00000000 --- a/.vitepress/theme/components/ReleaseTag.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - - - diff --git a/guide/index.md b/guide/index.md index 81a74ca0..0ba5a804 100644 --- a/guide/index.md +++ b/guide/index.md @@ -259,15 +259,10 @@ pnpm link --global # 在这一步中可使用你喜欢的包管理器 然后,回到你的 Vite 项目并运行 `pnpm link --global vite`(或者使用你的其他包管理工具来全局链接 `vite`)。重新启动开发服务器来体验新功能吧! -<<<<<<< HEAD +想了解更多关于 Vite 如何以及何时发布的信息,请查看 [releases](../releases)。md) 文档。 + ::: tip 处理依赖中的 Vite 版本 若需替换依赖链中传递使用的 Vite 版本(Transitive Dependencies),应使用 [npm overrides](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#overrides) 或 [pnpm overrides](https://pnpm.io/9.x/package_json#pnpmoverrides)。 -======= -To learn more about how and when Vite does releases, check out the [Releases](../releases.md) documentation. - -::: tip Dependencies using Vite -To replace the Vite version used by dependencies transitively, you should use [npm overrides](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#overrides) or [pnpm overrides](https://pnpm.io/9.x/package_json#pnpmoverrides). ->>>>>>> c82b4a8cd4f1c3d549b9a0b5948b8f607f606dad ::: ## 社区 {#community} diff --git a/releases.md b/releases.md index 6d5eb933..09a86e3d 100644 --- a/releases.md +++ b/releases.md @@ -1,12 +1,8 @@ -<<<<<<< HEAD -# 发布 {#releases} -======= -# Releases ->>>>>>> c82b4a8cd4f1c3d549b9a0b5948b8f607f606dad +# 发布 {#releases} Vite 的发布遵循 [语义化版本控制](https://semver.org/)。你可以在 [Vite npm 包页面](https://www.npmjs.com/package/vite) 查看 Vite 的最新稳定版本。 @@ -20,37 +16,22 @@ Vite 没有固定的发布周期。 - **次要版本** 总是包含新功能,并根据需要发布。且总会有一个 beta 预发布阶段(通常每两个月)。 - **主要版本** 通常与 [Node.js 生命周期终止计划](https://endoflife.date/nodejs) 保持一致,并会提前宣布。这些版本会经过与生态系统的长期讨论,并有 alpha 和 beta 预发布阶段(通常每年)。 -<<<<<<< HEAD -Vite 团队支持的 Vite 版本范围是这样确定的: -======= -## Supported Versions +## 支持版本 {#supported-versions} -In summary, the current supported Vite versions are: +当前支持的vite版本有:
-The supported version ranges are are automatically determined by: ->>>>>>> c82b4a8cd4f1c3d549b9a0b5948b8f607f606dad +支持的版本范围由以下因素确定: - **当前次要版本** 会定期提供修复。 - **上一个主要版本** (仅限其最新的次要版本)和 **上一个次要版本** 会接收重要修复和安全补丁。 - **倒数第二个主要版本** (仅限其最新的次要版本)和 **倒数第二个次要版本** 会接收安全补丁。 - 这些之前的所有版本将不再支持。 -<<<<<<< HEAD -例如,如果 Vite 最新版本为 5.3.10: - -- `vite@5.3` 会定期发布补丁版本。 -- 重要修复和安全补丁会回溯到 `vite@4` 和 `vite@5.2`。 -- 安全补丁也会回溯到 `vite@3` 和 `vite@5.1`。 -- `vite@2` 和 `vite@5.0` 不再支持更新。用户应升级以接收更新。 - 我们建议定期更新 Vite。在每次主要版本更新时,请查看 [迁移指南](/guide/migration)。Vite 团队与生态系统中的主要项目紧密合作,以确保新版本的质量。我们通过 [vite-ecosystem-ci 项目](https://github.com/vitejs/vite-ecosystem-ci) 在发布新版本前测试它们。大多数使用 Vite 的项目应该能够快速提供支持或迁移到新版本。 -======= -We recommend updating Vite regularly. Check out the [Migration Guides](https://vite.dev/guide/migration.html) when you update to each Major. The Vite team works closely with the main projects in the ecosystem to ensure the quality of new versions. We test new Vite versions before releasing them through the [vite-ecosystem-ci project](https://github.com/vitejs/vite-ecosystem-ci). Most projects using Vite should be able to quickly offer support or migrate to new versions as soon as they are released. ->>>>>>> c82b4a8cd4f1c3d549b9a0b5948b8f607f606dad ## 语义化版本控制的特殊情况 {#semantic-versioning-edge-cases} From c6ae1fae4faf312a9c287755c1e1dc4cf673f0cc Mon Sep 17 00:00:00 2001 From: waynzh Date: Thu, 6 Nov 2025 10:45:10 +0800 Subject: [PATCH 5/6] docs(cn): update config --- .vitepress/theme/index.ts | 7 ++----- .vitepress/utils/useReleaseTag.ts | 15 --------------- 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 .vitepress/utils/useReleaseTag.ts diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index ebae52f0..7a67b153 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -8,7 +8,6 @@ import './styles/landing.css' import AsideSponsors from './components/AsideSponsors.vue' import SvgImage from './components/SvgImage.vue' import WwAds from './components/WwAds.vue' -import ReleaseTag from './components/ReleaseTag.vue' import './custom.css' import YouTubeVideo from './components/YouTubeVideo.vue' import SponsorBanner from './components/SponsorBanner.vue' @@ -21,15 +20,13 @@ export default { return h(DefaultTheme.Layout, null, { 'aside-outline-after': () => h(WwAds), 'layout-top': () => h(SponsorBanner), - 'aside-ads-before': () => h(AsideSponsors), + 'aside-ads-before': () => h(AsideSponsors) }) }, enhanceApp({ app }) { app.component('SvgImage', SvgImage) - app.component('ReleaseTag', ReleaseTag) app.component('YouTubeVideo', YouTubeVideo) app.component('NonInheritBadge', NonInheritBadge) app.use(TwoslashFloatingVue) - }, + } } satisfies Theme - diff --git a/.vitepress/utils/useReleaseTag.ts b/.vitepress/utils/useReleaseTag.ts deleted file mode 100644 index 2cd51836..00000000 --- a/.vitepress/utils/useReleaseTag.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { onMounted, ref } from 'vue' - -export function useReleaseTag() { - const releaseTag = ref('') - - onMounted(async () => { - const result = await fetch('https://api.github.com/repos/vitejs/docs-cn/releases/latest') - const json = await result.json() - releaseTag.value = json?.tag_name ?? '' - }) - - return { - releaseTag - } -} From e53a66476c191096ea9c24ea0854eae5faa6ce01 Mon Sep 17 00:00:00 2001 From: waynzh Date: Thu, 6 Nov 2025 10:51:37 +0800 Subject: [PATCH 6/6] feat: sync vite version --- .vitepress/config.ts | 8 +++++--- guide/index.md | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 9c4b5ae3..6981f2f4 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -8,9 +8,11 @@ import { groupIconVitePlugin } from 'vitepress-plugin-group-icons' import { markdownItImageSize } from 'markdown-it-image-size' +import packageJson from '../package.json' with { type: 'json' } import { buildEnd } from './buildEnd.config' -const viteMajorVersion = 7 +const viteVersion = packageJson.version +const viteMajorVersion = +viteVersion.split('.')[0] const ogDescription = 'Next Generation Frontend Tooling' const ogImage = 'https://vite.dev/og-image.jpg' @@ -218,7 +220,7 @@ export default defineConfig({ ] }, { - text: `v${viteMajorVersion}`, + text: `v${viteVersion}`, items: [ { text: '更新日志', @@ -491,7 +493,7 @@ export default defineConfig({ ] }, define: { - __VITE_VERSION__: JSON.stringify(viteMajorVersion) + __VITE_VERSION__: JSON.stringify(viteVersion) } }, buildEnd diff --git a/guide/index.md b/guide/index.md index 0ba5a804..f6194d9f 100644 --- a/guide/index.md +++ b/guide/index.md @@ -259,7 +259,7 @@ pnpm link --global # 在这一步中可使用你喜欢的包管理器 然后,回到你的 Vite 项目并运行 `pnpm link --global vite`(或者使用你的其他包管理工具来全局链接 `vite`)。重新启动开发服务器来体验新功能吧! -想了解更多关于 Vite 如何以及何时发布的信息,请查看 [releases](../releases)。md) 文档。 +想了解更多关于 Vite 如何以及何时发布的信息,请查看 [发布](../releases.md) 文档。 ::: tip 处理依赖中的 Vite 版本 若需替换依赖链中传递使用的 Vite 版本(Transitive Dependencies),应使用 [npm overrides](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#overrides) 或 [pnpm overrides](https://pnpm.io/9.x/package_json#pnpmoverrides)。 diff --git a/package.json b/package.json index c8f7e2c8..8ba1c6c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vite-docs-cn", - "version": "1.0.0", + "version": "7.2.0", "description": "Vite.js documentation Chinese translation.", "repository": "https://github.com/vitejs/docs-cn", "type": "module",