From 01125ee26e208f997a636b372917c12da4cc7927 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 14:42:45 +0900 Subject: [PATCH 1/5] fix(deps): update all non-major dependencies (#21488) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5a7cf8fc..fd92cd1f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "devDependencies": { "@shikijs/vitepress-twoslash": "^3.21.0", "@types/express": "^5.0.6", - "@voidzero-dev/vitepress-theme": "^4.2.1", + "@voidzero-dev/vitepress-theme": "^4.3.0", "feed": "^5.2.0", "markdown-it-image-size": "^15.0.1", "oxc-minify": "^0.110.0", @@ -18,6 +18,6 @@ "vitepress-plugin-group-icons": "^1.7.1", "vitepress-plugin-llms": "^1.10.0", "vue": "^3.5.27", - "vue-tsc": "^3.2.2" + "vue-tsc": "^3.2.4" } } From 6b70465087c357cc9028402e2ca9f92720e2c352 Mon Sep 17 00:00:00 2001 From: Per Harald Borgen Date: Mon, 26 Jan 2026 08:37:53 +0100 Subject: [PATCH 2/5] docs: add Scrimba tutorial links across documentation (#21467) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Per Harald Borgen Co-authored-by: 翠 Co-authored-by: Per Harald Borgen Co-authored-by: Claude Opus 4.5 --- .vitepress/theme/components/ScrimbaLink.vue | 56 +++++++++++++++++++++ .vitepress/theme/index.ts | 2 + config/index.md | 2 + guide/build.md | 2 + guide/env-and-mode.md | 2 + guide/features.md | 2 + guide/index.md | 4 ++ guide/using-plugins.md | 2 + 8 files changed, 72 insertions(+) create mode 100644 .vitepress/theme/components/ScrimbaLink.vue diff --git a/.vitepress/theme/components/ScrimbaLink.vue b/.vitepress/theme/components/ScrimbaLink.vue new file mode 100644 index 00000000..6b3b0d7a --- /dev/null +++ b/.vitepress/theme/components/ScrimbaLink.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index 602e890a..d8026cb2 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -10,6 +10,7 @@ import SvgImage from './components/SvgImage.vue' import YouTubeVideo from './components/YouTubeVideo.vue' import NonInheritBadge from './components/NonInheritBadge.vue' import AsideSponsors from './components/AsideSponsors.vue' +import ScrimbaLink from './components/ScrimbaLink.vue' export default { Layout() { @@ -23,6 +24,7 @@ export default { app.component('SvgImage', SvgImage) app.component('YouTubeVideo', YouTubeVideo) app.component('NonInheritBadge', NonInheritBadge) + app.component('ScrimbaLink', ScrimbaLink) app.use(TwoslashFloatingVue) Theme.enhanceApp(ctx) diff --git a/config/index.md b/config/index.md index 17321316..16a1ef34 100644 --- a/config/index.md +++ b/config/index.md @@ -22,6 +22,8 @@ You can also explicitly specify a config file to use with the `--config` CLI opt vite --config my-config.js ``` +Watch an interactive lesson on Scrimba + ::: tip CONFIG LOADING By default, Vite uses [Rolldown](https://rolldown.rs/) to bundle the config into a temporary file and load it. This may cause issues when importing TypeScript files in a monorepo. If you encounter any issues with this approach, you can specify `--configLoader runner` to use the [module runner](/guide/api-environment-runtimes.html#modulerunner) instead, which will not create a temporary config and will transform any files on the fly. Note that module runner doesn't support CJS in config files, but external CJS packages should work as usual. diff --git a/guide/build.md b/guide/build.md index e2b91633..b33b7dde 100644 --- a/guide/build.md +++ b/guide/build.md @@ -2,6 +2,8 @@ When it is time to deploy your app for production, simply run the `vite build` command. By default, it uses `/index.html` as the build entry point, and produces an application bundle that is suitable to be served over a static hosting service. Check out the [Deploying a Static Site](./static-deploy) for guides about popular services. +Watch an interactive lesson on Scrimba + ## Browser Compatibility By default, the production bundle assumes a modern browser that is included in the [Baseline](https://web-platform-dx.github.io/web-features/) Widely Available targets. The default browser support range is: diff --git a/guide/env-and-mode.md b/guide/env-and-mode.md index 07d15fc5..70d04800 100644 --- a/guide/env-and-mode.md +++ b/guide/env-and-mode.md @@ -13,6 +13,8 @@ if (import.meta.env.DEV) { ::: +Watch an interactive lesson on Scrimba + ## Built-in Constants Some built-in constants are available in all cases: diff --git a/guide/features.md b/guide/features.md index 1e48b12f..5b5b315d 100644 --- a/guide/features.md +++ b/guide/features.md @@ -367,6 +367,8 @@ By default, Vite uses esbuild to minify CSS. Lightning CSS can also be used as t ## Static Assets +Watch an interactive lesson on Scrimba + Importing a static asset will return the resolved public URL when it is served: ```js twoslash diff --git a/guide/index.md b/guide/index.md index 1772227d..d91a7580 100644 --- a/guide/index.md +++ b/guide/index.md @@ -18,6 +18,8 @@ Vite is also highly extensible via its [Plugin API](./api-plugin) and [JavaScrip You can learn more about the rationale behind the project in the [Why Vite](./why) section. +Learn Vite through interactive tutorials on Scrimba + ## Browser Support During development, Vite assumes that a modern browser is used. This means the browser supports most of the latest JavaScript and CSS features. For that reason, Vite sets [`esnext` as the transform target](https://esbuild.github.io/api/#target). This prevents syntax lowering, letting Vite serve modules as close as possible to the original source code. Vite injects some runtime code to make the development server work. This code uses features included in [Baseline](https://web-platform-dx.github.io/web-features/) Newly Available at the time of each major release (2026-01-01 for this major). @@ -69,6 +71,8 @@ $ deno init --npm vite Then follow the prompts! +Watch an interactive lesson on Scrimba + ::: tip Compatibility Note Vite requires [Node.js](https://nodejs.org/en/) version 20.19+, 22.12+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it. ::: diff --git a/guide/using-plugins.md b/guide/using-plugins.md index b168b11f..3bb8ed0a 100644 --- a/guide/using-plugins.md +++ b/guide/using-plugins.md @@ -2,6 +2,8 @@ Vite can be extended using plugins, which are based on Rollup's well-designed plugin interface with a few extra Vite-specific options. This means that Vite users can rely on the mature ecosystem of Rollup plugins, while also being able to extend the dev server and SSR functionality as needed. +Watch an interactive lesson on Scrimba + ## Adding a Plugin To use a plugin, it needs to be added to the `devDependencies` of the project and included in the `plugins` array in the `vite.config.js` config file. For example, to provide support for legacy browsers, the official [@vitejs/plugin-legacy](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy) can be used: From 13022a7db136f2900b7dcaf64a10348fb4141aec Mon Sep 17 00:00:00 2001 From: waynzh Date: Tue, 27 Jan 2026 16:23:53 +0800 Subject: [PATCH 3/5] docs(cn): resolve conflicts --- config/index.md | 9 ++------- guide/build.md | 8 ++------ guide/env-and-mode.md | 10 +++------- guide/features.md | 8 ++------ guide/index.md | 17 ++++------------- guide/using-plugins.md | 8 ++------ 6 files changed, 15 insertions(+), 45 deletions(-) diff --git a/config/index.md b/config/index.md index d7808afc..41ed3819 100644 --- a/config/index.md +++ b/config/index.md @@ -22,15 +22,10 @@ export default { vite --config my-config.js ``` -<<<<<<< HEAD +在 Scrimba 上观看互动课程 + ::: tip 加载配置文件 默认情况下,Vite 使用 [Rolldown](https://rolldown.rs/) 将配置文件打包到临时文件中并加载它。这可能会在 monorepo 中导入 TypeScript 文件时引发问题。如果你遇到了这种方法问题,可以通过指定 `--configLoader runner` 以改用 [module runner](/guide/api-environment-runtimes.html#modulerunner),它不会创建临时配置并将动态转换任何文件。请注意,module runner 不支持配置文件中的 CJS,但外部 CJS 包应该可以正常工作。 -======= -Watch an interactive lesson on Scrimba - -::: tip CONFIG LOADING -By default, Vite uses [Rolldown](https://rolldown.rs/) to bundle the config into a temporary file and load it. This may cause issues when importing TypeScript files in a monorepo. If you encounter any issues with this approach, you can specify `--configLoader runner` to use the [module runner](/guide/api-environment-runtimes.html#modulerunner) instead, which will not create a temporary config and will transform any files on the fly. Note that module runner doesn't support CJS in config files, but external CJS packages should work as usual. ->>>>>>> 6b70465087c357cc9028402e2ca9f92720e2c352 另外,如果你正在使用支持TypeScript的环境(例如 `node --experimental-strip-types`),或者只编写纯 JavaScript 代码,你可以指定 `--configLoader native` 以使用环境的本机运行时加载配置文件。请注意,配置文件导入的模块的更新不会被检测到,因此不会自动重启 Vite 服务器。 ::: diff --git a/guide/build.md b/guide/build.md index c715e0f3..641160f7 100644 --- a/guide/build.md +++ b/guide/build.md @@ -2,13 +2,9 @@ 当需要将应用部署到生产环境时,只需运行 `vite build` 命令。默认情况下,它使用 `/index.html` 作为其构建入口点,并生成能够静态部署的应用程序包。请查阅 [部署静态站点](./static-deploy) 获取常见服务的部署指引。 -<<<<<<< HEAD -## 浏览器兼容性 {#browser-compatibility} -======= -Watch an interactive lesson on Scrimba +在 Scrimba 上观看互动课程 -## Browser Compatibility ->>>>>>> 6b70465087c357cc9028402e2ca9f92720e2c352 +## 浏览器兼容性 {#browser-compatibility} 默认情况下,生产包假定使用包含在 [Baseline](https://web-platform-dx.github.io/web-features/) 广泛可用目标中的现代浏览器。默认的浏览器支持范围是: diff --git a/guide/env-and-mode.md b/guide/env-and-mode.md index 9a0689cb..489d89f4 100644 --- a/guide/env-and-mode.md +++ b/guide/env-and-mode.md @@ -2,7 +2,7 @@ Vite 在特殊的 `import.meta.env` 对象下暴露了一些常量。这些常量在开发阶段被定义为全局变量,并在构建阶段被静态替换,以使树摇(tree-shaking)更有效。 -:::details Example +:::details 示例 ```js if (import.meta.env.DEV) { @@ -13,13 +13,9 @@ if (import.meta.env.DEV) { ::: -<<<<<<< HEAD -## 内置常量 {#built-in-constants} -======= -Watch an interactive lesson on Scrimba +在 Scrimba 上观看互动课程 -## Built-in Constants ->>>>>>> 6b70465087c357cc9028402e2ca9f92720e2c352 +## 内置常量 {#built-in-constants} 一些内置常量在所有情况下都可用: diff --git a/guide/features.md b/guide/features.md index 246d21b1..97b7df38 100644 --- a/guide/features.md +++ b/guide/features.md @@ -367,13 +367,9 @@ npm add -D lightningcss ## 静态资源处理 {#static-assets} -<<<<<<< HEAD -导入一个静态资源会返回解析后的 URL: -======= -Watch an interactive lesson on Scrimba +在 Scrimba 上观看互动课程 -Importing a static asset will return the resolved public URL when it is served: ->>>>>>> 6b70465087c357cc9028402e2ca9f92720e2c352 +导入一个静态资源会返回解析后的 URL: ```js twoslash import 'vite/client' diff --git a/guide/index.md b/guide/index.md index c781ec80..ba1be3ca 100644 --- a/guide/index.md +++ b/guide/index.md @@ -18,13 +18,9 @@ Vite 还提供了强大的扩展性,可通过其 [插件 API](./api-plugin) 你可以在 [为什么选 Vite](./why) 部分深入了解该项目的设计理念。 -<<<<<<< HEAD -## 浏览器支持 {#browser-support} -======= -Learn Vite through interactive tutorials on Scrimba +在 Scrimba 上观看互动课程 -## Browser Support ->>>>>>> 6b70465087c357cc9028402e2ca9f92720e2c352 +## 浏览器支持 {#browser-support} 在开发过程中,Vite 假设使用的是现代浏览器。这意味着该浏览器支持大多数最新的 JavaScript 和 CSS 功能。因此,Vite 将 [`esnext` 设置为转换目标](https://esbuild.github.io/api/#target)。这可以防止语法降低,使 Vite 能够尽可能接近原始源代码提供模块。Vite 会注入一些运行时代码以使开发服务器正常工作。这些代码使用了 [Baseline](https://web-platform-dx.github.io/web-features/) 中包含的功能,该功能在每个主要版本发布时(此主要版本为 2026-01-01)新增。 @@ -75,15 +71,10 @@ $ deno init --npm vite 然后按照提示操作即可! -<<<<<<< HEAD +在 Scrimba 上观看互动课程 + ::: tip 兼容性注意 Vite 需要 [Node.js](https://nodejs.org/en/) 版本 20.19+, 22.12+。然而,有些模板需要依赖更高的 Node 版本才能正常运行,当你的包管理器发出警告时,请注意升级你的 Node 版本。 -======= -Watch an interactive lesson on Scrimba - -::: tip Compatibility Note -Vite requires [Node.js](https://nodejs.org/en/) version 20.19+, 22.12+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it. ->>>>>>> 6b70465087c357cc9028402e2ca9f92720e2c352 ::: :::: details 使用命令行选项创建 vite diff --git a/guide/using-plugins.md b/guide/using-plugins.md index 9593920f..d766ec6c 100644 --- a/guide/using-plugins.md +++ b/guide/using-plugins.md @@ -2,13 +2,9 @@ Vite 可以使用插件进行扩展,这得益于 Rollup 优秀的插件接口设计和一部分 Vite 独有的额外选项。这意味着 Vite 用户可以利用 Rollup 插件的强大生态系统,同时根据需要也能够扩展开发服务器和 SSR 功能。 -<<<<<<< HEAD -## 添加一个插件 {#adding-a-plugin} -======= -Watch an interactive lesson on Scrimba +在 Scrimba 上观看互动课程 -## Adding a Plugin ->>>>>>> 6b70465087c357cc9028402e2ca9f92720e2c352 +## 添加一个插件 {#adding-a-plugin} 若要使用一个插件,需要将它添加到项目的 `devDependencies` 并在 `vite.config.js` 配置文件中的 `plugins` 数组中引入它。例如,要想为传统浏览器提供支持,可以按下面这样使用官方插件 [@vitejs/plugin-legacy](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy): From 9c3351b2f75ac7380432dbcf4d865c6fc76c2e6f Mon Sep 17 00:00:00 2001 From: waynzh Date: Tue, 27 Jan 2026 16:28:19 +0800 Subject: [PATCH 4/5] chore: update deps --- _data/team.js | 2 +- package.json | 26 +------------------------- pnpm-lock.yaml | 25 +++++++++++++++++++------ 3 files changed, 21 insertions(+), 32 deletions(-) diff --git a/_data/team.js b/_data/team.js index d3dc79d3..9d0cf4fb 100644 --- a/_data/team.js +++ b/_data/team.js @@ -247,7 +247,7 @@ export const cnTranslator = [ }, { avatar: 'https://www.github.com/waynzh.png', - name: 'Wayne Zhang', + name: 'waynzh', title: '前端开发者', org: '', orgLink: '', diff --git a/package.json b/package.json index b1d7e93c..de783613 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,4 @@ { -<<<<<<< HEAD "name": "vite-docs-cn", "version": "8.0.0-beta.0", "description": "Vite.js documentation Chinese translation.", @@ -24,7 +23,7 @@ "vitepress": "2.0.0-alpha.15", "vitepress-plugin-group-icons": "^1.7.1", "vue": "^3.5.27", - "vue-tsc": "^3.2.3", + "vue-tsc": "^3.2.4", "yorkie": "^2.0.0" }, "packageManager": "pnpm@9.6.0", @@ -40,27 +39,4 @@ "gitHooks": { "commit-msg": "node scripts/verifyCommit.js" } -======= - "name": "@vitejs/monorepo-docs", - "private": true, - "type": "module", - "scripts": { - "docs": "vitepress dev", - "docs-build": "vitepress build", - "docs-serve": "vitepress serve" - }, - "devDependencies": { - "@shikijs/vitepress-twoslash": "^3.21.0", - "@types/express": "^5.0.6", - "@voidzero-dev/vitepress-theme": "^4.3.0", - "feed": "^5.2.0", - "markdown-it-image-size": "^15.0.1", - "oxc-minify": "^0.110.0", - "vitepress": "^2.0.0-alpha.15", - "vitepress-plugin-group-icons": "^1.7.1", - "vitepress-plugin-llms": "^1.10.0", - "vue": "^3.5.27", - "vue-tsc": "^3.2.4" - } ->>>>>>> 6b70465087c357cc9028402e2ca9f92720e2c352 } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 317de915..063b9695 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,8 +54,8 @@ importers: specifier: ^3.5.27 version: 3.5.27(typescript@5.9.3) vue-tsc: - specifier: ^3.2.3 - version: 3.2.3(typescript@5.9.3) + specifier: ^3.2.4 + version: 3.2.4(typescript@5.9.3) yorkie: specifier: ^2.0.0 version: 2.0.0 @@ -714,6 +714,9 @@ packages: '@vue/language-core@3.2.3': resolution: {integrity: sha512-VpN/GnYDzGLh44AI6i1OB/WsLXo6vwnl0EWHBelGc4TyC0yEq6azwNaed/+Tgr8anFlSdWYnMEkyHJDPe7ii7A==} + '@vue/language-core@3.2.4': + resolution: {integrity: sha512-bqBGuSG4KZM45KKTXzGtoCl9cWju5jsaBKaJJe3h5hRAAWpZUuj5G+L+eI01sPIkm4H6setKRlw7E85wLdDNew==} + '@vue/reactivity@3.5.27': resolution: {integrity: sha512-vvorxn2KXfJ0nBEnj4GYshSgsyMNFnIQah/wczXlsNXt+ijhugmW+PpJ2cNPe4V6jpnBcs0MhCODKllWG+nvoQ==} @@ -1657,8 +1660,8 @@ packages: peerDependencies: vue: ^3.0.0 - vue-tsc@3.2.3: - resolution: {integrity: sha512-1RdRB7rQXGFMdpo0aXf9spVzWEPGAk7PEb/ejHQwVrcuQA/HsGiixIc3uBQeqY2YjeEEgvr2ShQewBgcN4c1Cw==} + vue-tsc@3.2.4: + resolution: {integrity: sha512-xj3YCvSLNDKt1iF9OcImWHhmYcihVu9p4b9s4PGR/qp6yhW+tZJaypGxHScRyOrdnHvaOeF+YkZOdKwbgGvp5g==} hasBin: true peerDependencies: typescript: '>=5.0.0' @@ -2309,6 +2312,16 @@ snapshots: path-browserify: 1.0.1 picomatch: 4.0.3 + '@vue/language-core@3.2.4': + dependencies: + '@volar/language-core': 2.4.27 + '@vue/compiler-dom': 3.5.27 + '@vue/shared': 3.5.27 + alien-signals: 3.1.2 + muggle-string: 0.4.1 + path-browserify: 1.0.1 + picomatch: 4.0.3 + '@vue/reactivity@3.5.27': dependencies: '@vue/shared': 3.5.27 @@ -3344,10 +3357,10 @@ snapshots: dependencies: vue: 3.5.27(typescript@5.9.3) - vue-tsc@3.2.3(typescript@5.9.3): + vue-tsc@3.2.4(typescript@5.9.3): dependencies: '@volar/typescript': 2.4.27 - '@vue/language-core': 3.2.3 + '@vue/language-core': 3.2.4 typescript: 5.9.3 vue@3.5.27(typescript@5.9.3): From 77dc72fe93cf82ce4d93e9ffe333891457693b36 Mon Sep 17 00:00:00 2001 From: waynzh Date: Tue, 27 Jan 2026 16:30:32 +0800 Subject: [PATCH 5/5] chore: update version --- .vitepress/theme/components/ScrimbaLink.vue | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.vitepress/theme/components/ScrimbaLink.vue b/.vitepress/theme/components/ScrimbaLink.vue index 6b3b0d7a..32761ea0 100644 --- a/.vitepress/theme/components/ScrimbaLink.vue +++ b/.vitepress/theme/components/ScrimbaLink.vue @@ -11,7 +11,7 @@ defineProps<{ - Watch an interactive lesson on Scrimba + 在 Scrimba 上观看互动课程 diff --git a/package.json b/package.json index de783613..fbd60e4c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vite-docs-cn", - "version": "8.0.0-beta.0", + "version": "8.0.0-beta.10", "description": "Vite.js documentation Chinese translation.", "repository": "https://github.com/vitejs/docs-cn", "type": "module",