diff --git a/.vitepress/theme/components/YouTubeVideo.vue b/.vitepress/theme/components/YouTubeVideo.vue index 59f05d56..7052904c 100644 --- a/.vitepress/theme/components/YouTubeVideo.vue +++ b/.vitepress/theme/components/YouTubeVideo.vue @@ -12,7 +12,14 @@ defineProps({ :src="`https://www.youtube.com/embed/${videoId}`" title="YouTube video player" frameborder="0" - allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" + allow=" + accelerometer; + autoplay; + clipboard-write; + encrypted-media; + gyroscope; + picture-in-picture; + " allowfullscreen > diff --git a/guide/features.md b/guide/features.md index 33407804..4060fb83 100644 --- a/guide/features.md +++ b/guide/features.md @@ -53,6 +53,10 @@ export type { T } ### TypeScript 编译器选项 {#typescript-compiler-options} +Vite 会参考 `tsconfig.json` 中的一些配置项,并设置相应的 esbuild 选项。对于每个文件,Vite 会使用距离最近的父级目录中的 `tsconfig.json`。如果该 `tsconfig.json` 包含 [`references`](https://www.typescriptlang.org/tsconfig/#references) 字段,Vite 将使用满足 [`include`](https://www.typescriptlang.org/tsconfig/#include) 和 [`exclude`](https://www.typescriptlang.org/tsconfig/#exclude) 字段的被引用配置文件。 + +当选项同时在 Vite 配置和 `tsconfig.json` 中设置时,Vite 配置中的值优先。 + `tsconfig.json` 中 `compilerOptions` 下的一些配置项需要特别注意。 #### `isolatedModules` diff --git a/guide/index.md b/guide/index.md index f6194d9f..c03e92b5 100644 --- a/guide/index.md +++ b/guide/index.md @@ -106,6 +106,8 @@ $ deno init --npm vite my-vue-app --template vue 你可以使用 `.` 作为项目名称,在当前目录中创建项目脚手架。 +要创建一个没有交互式提示的项目,你可以使用 `--no-interactive` 标志。 + :::: ## 社区模板 {#community-templates} diff --git a/guide/philosophy.md b/guide/philosophy.md index 09f8dee0..4b061e43 100644 --- a/guide/philosophy.md +++ b/guide/philosophy.md @@ -16,7 +16,7 @@ Vite 提供了一系列推动编写现代代码的特定功能。例如: ## 旨在高性能的实用解决方案 {#a-pragmatic-approach-to-performance} -Vite 自其诞生之初(详见:[为什么选 Vite](./why.md))就一直致力于性能优化。其开发服务器架构设计确保了随着项目规模扩大,模块热替换(HMR)仍能保持高速运行。Vite 采用类似 [esbuild](https://esbuild.github.io/) 和 [SWC](https://github.com/vitejs/vite-plugin-react-swc) 这样的原生工具处理复杂的任务,同时将其他部分代码保留在 JavaScript 中,以实现速度与灵活性之间的平衡。在需要时,框架插件会利用 [Babel](https://babeljs.io/) 来编译用户代码。构建阶段,Vite 当前使用的是 [Rollup](https://cn.rollupjs.org/) ,此时包体积大小以及能够接入广泛生态系统的插件比原始速度更重要。Vite 将持续内部改进和发展,在新库出现时适时采用以提升开发者体验(DX),同时保持 API 的稳定性。 +Vite 自其诞生之初(详见:[为什么选 Vite](./why.md))就一直致力于性能优化。其开发服务器架构设计确保了随着项目规模扩大,模块热替换(HMR)仍能保持高速运行。Vite 采用类似 [esbuild](https://esbuild.github.io/) 和 [SWC](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react-swc) 这样的原生工具处理复杂的任务,同时将其他部分代码保留在 JavaScript 中,以实现速度与灵活性之间的平衡。在需要时,框架插件会利用 [Babel](https://babeljs.io/) 来编译用户代码。构建阶段,Vite 当前使用的是 [Rollup](https://cn.rollupjs.org/) ,此时包体积大小以及能够接入广泛生态系统的插件比原始速度更重要。Vite 将持续内部改进和发展,在新库出现时适时采用以提升开发者体验(DX),同时保持 API 的稳定性。 ## 基于 Vite 构建框架 {#building-frameworks-on-top-of-vite}