Vitesse Lite
repository·main·Indexed 23 days ago
https://github.com/antfu-collective/vitesse-liteA lightweight, high-performance Vue 3 starter template built with Vite, pnpm, and ESBuild. It provides a streamlined development experience by focusing on core essentials and removing complex features like i18n, SSG, PWA, and Markdown. Key features include file-based routing via unplugin-vue-router, auto-importing components and APIs, UnoCSS for styling, Iconify for icons, VueUse utilities, and Vitest for testing.
What's inside Vitesse Lite
- Vitesse Lite is a lightweight, opinionated Vite starter template. It provides a fast development experience using Vue 3, Vite, pnpm, and ESBuild. It is designed to be a stripped-down version of the original Vitesse, focusing on core essentials while removing features like i18n, Layouts, SSG, PWA, and Markdown to keep the footprint minimal.
Overview of Vitesse Lite
mainVitesse Lite is a lightweight, opinionated starter template for Vue 3 projects. It is designed for speed and developer experience, utilizing Vite, pnpm, and ESBuild. It provides a streamlined version of the original Vitesse template by removing complex features like i18n, layouts, SSG, PWA, and Markdown support to focus on a core, fast development workflow.Core features and pre-configured plugins
mainVitesse Lite comes pre-configured with several tools to streamline development:
Routing and Components
- File-based routing: Uses
Vue Routerwith routing defined by the file system in./src/pages. - Component auto-import: Uses
unplugin-vue-componentsto automatically load components from./src/components. - Auto-importing APIs: Uses
unplugin-auto-importso you can use Composition API functions directly without manual imports.
Styling and Icons
- UnoCSS: A high-performance, flexible atomic CSS engine.
- Icons: Supports
IconifyandUnoCSS preset-iconsfor using any icon set (browse icons at Icônes).
Utilities and Language
- Vue Macros: Uses
unplugin-vue-macrosto extend Vue with more macros and syntactic sugar. - VueUse: Includes the
VueUsecollection of practical Composition API utilities. - TypeScript: Full TypeScript support.
- Vitest: Pre-configured for unit and component testing.
- Deployment: Zero-config deployment to Netlify.
- File-based routing: Uses
Use path aliasing with `~/`
mainThe~/prefix is aliased to the./src/directory. This allows you to avoid complex relative paths (e.g.,../../../../) when importing files from the source folder.Use icons via Iconify
mainYou can use icons from almost any icon set using Iconify. The project usesunplugin-iconsto ensure that only the specific icons you actually use are bundled into your application, keeping the bundle size small.Core features and pre-packed technologies in Vitesse Lite
mainVitesse Lite comes pre-configured with several powerful tools to enhance your development workflow:
Routing and Components
- File-based routing: Uses
Vue Routerwith routing defined by the files in./src/pages. - Auto-importing:
- Components in
./src/componentsare automatically imported. - Uses
unplugin-auto-importto allow direct use of the Vue Composition API and other utilities without manual import statements. - Uses
unplugin-vue-componentsfor automatic component registration.
- Components in
Styling and Icons
- UnoCSS: An instant, on-demand atomic CSS engine.
- Icons:
- Supports Iconify for accessing various icon sets.
- Supports Pure CSS Icons via the UnoCSS
preset-icons.
Utilities and Macros
- Vue Macros: Uses
unplugin-vue-macrosto extend Vue with additional macros and syntax sugar. - VueUse: Includes the
VueUsecollection of essential Composition API utilities.
Testing and Deployment
- Vitest: Used for unit and component testing.
- Netlify: Optimized for zero-config deployment on Netlify.
- File-based routing: Uses
Use auto-registered components
mainComponents located in thesrc/componentsdirectory are automatically registered and loaded on-demand. You do not need to manually import them in your Vue files. This is powered byunplugin-vue-components.Use file-based routing for pages
mainRoutes are automatically generated based on the Vue files located in thesrc/pagesdirectory, following the file structure. This project usesunplugin-vue-routerto manage the routing logic and integrates withvue router. To add a new route, simply create a new.vuefile within the directory structure.Get started with Vitesse Lite
mainYou can start a new project using Vitesse Lite in two ways: using the GitHub template or cloning manually via
degitfor a cleaner git history.Option 1: GitHub Template
You can create a new repository directly from the GitHub template interface.
Option 2: Manual Clone (Recommended for clean history)
Run the following commands to scaffold your project locally:
npx degit antfu-collective/vitesse-lite my-vitesse-app cd my-vitesse-app pnpm iNote: If you do not have
pnpminstalled, you can install it globally usingnpm install -g pnpm.Clone Vitesse Lite to local
mainTo start a new project with a clean git history, you can use
degitto clone the template. Ensure you havepnpminstalled; if not, you can install it globally vianpm install -g pnpm.npx degit antfu-collective/vitesse-lite my-vitesse-app cd my-vitesse-app pnpm i # 如果你没装过 pnpm, 可以先运行: npm install -g pnpmUse Vitesse Lite as a GitHub Template
mainYou can create a new repository directly from the Vitesse Lite GitHub template by visiting the template generation URL.
https://github.com/antfu-collective/vitesse-lite/generateConfigure ESLint with @antfu/eslint-config
mainThe project uses
@antfu/eslint-configfor linting. You can customize the configuration by passing an options object to theantfu()function in youreslint.config.jsfile.Available configuration options in this project include:
unocss: Enables UnoCSS-specific linting rules when set totrue.formatters: Enables ESLint formatters (e.g., for Prettier-like behavior) when set totrue.pnpm: Enables specific rules or configurations optimized forpnpmwhen set totrue.
import antfu from '@antfu/eslint-config' export default antfu( { unocss: true, formatters: true, pnpm: true, }, )