vite

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Vite is a modern build tool for frontend development featuring instant server start with native ES modules, lightning-fast HMR, and optimized production builds using Rolldown/Rollup. It supports TypeScript, JSX, CSS pre-processors out of the box and has a rich plugin ecosystem.
The skill is based on Vite 6.x, generated at 2026-01-28.
Vite是一款面向前端开发的现代化构建工具,它借助原生ES模块实现服务器即时启动,拥有闪电般快速的HMR,并通过Rolldown/Rollup完成优化的生产环境构建。它开箱即用地支持TypeScript、JSX、CSS预处理器,且具备丰富的插件生态系统。
本技能基于Vite 6.x版本,生成于2026年1月28日。

Core

核心功能

TopicDescriptionReference
ConfigurationConfig file setup, defineConfig, conditional and async configscore-config
CLI CommandsDev server, build, preview commands and optionscore-cli
Core FeaturesTypeScript, JSX, CSS, HTML processing, JSON handlingcore-features
Using PluginsAdding, configuring, and ordering pluginscore-plugins
主题描述参考文档
配置配置文件设置、defineConfig、条件式与异步配置core-config
CLI命令开发服务器、构建、预览命令及选项core-cli
核心特性TypeScript、JSX、CSS、HTML处理、JSON解析core-features
插件使用插件的添加、配置与排序core-plugins

Features

功能特性

TopicDescriptionReference
CSS HandlingCSS modules, pre-processors, PostCSS, Lightning CSSfeatures-css
Static AssetsAsset imports, public directory, URL handlingfeatures-assets
Glob Importimport.meta.glob, dynamic imports, batch loadingfeatures-glob-import
Environment Variables.env files, modes, import.meta.env constantsfeatures-env
HMR APIHot Module Replacement client APIfeatures-hmr
Web WorkersWorker imports and configurationfeatures-workers
Dependency Pre-BundlingoptimizeDeps, caching, monorepo setupfeatures-dep-bundling
主题描述参考文档
CSS处理CSS模块、预处理器、PostCSS、Lightning CSSfeatures-css
静态资源资源导入、公共目录、URL处理features-assets
全局导入import.meta.glob、动态导入、批量加载features-glob-import
环境变量.env文件、模式、import.meta.env常量features-env
HMR API热模块替换客户端APIfeatures-hmr
Web WorkersWorker导入与配置features-workers
依赖预构建optimizeDeps、缓存、单仓库配置features-dep-bundling

Build

构建模块

TopicDescriptionReference
Production BuildBuild options, browser targets, multi-page appsbuild-production
Library ModeBuilding libraries with proper package exportsbuild-library
SSRServer-side rendering setup and configurationbuild-ssr
主题描述参考文档
生产环境构建构建选项、浏览器目标、多页面应用build-production
库模式构建具备规范包导出的类库build-library
SSR服务端渲染的搭建与配置build-ssr

Advanced

进阶内容

TopicDescriptionReference
JavaScript APIcreateServer, build, preview programmatic APIsadvanced-api
Plugin APICreating Vite plugins, hooks, virtual modulesadvanced-plugin-api
PerformanceOptimization tips for dev server and buildsadvanced-performance
Backend IntegrationIntegrating Vite with traditional backendsadvanced-backend
主题描述参考文档
JavaScript APIcreateServer、build、preview程序化APIadvanced-api
插件API创建Vite插件、钩子、虚拟模块advanced-plugin-api
性能优化开发服务器与构建的优化技巧advanced-performance
后端集成Vite与传统后端的集成方案advanced-backend