Overview
elenext is a template designed to help developers get started with Vue 3 in Vite. It provides a recommended IDE setup and offers solutions for handling type information and imports within TypeScript.
Features
- Recommended IDE Setup: The template suggests using Visual Studio Code along with Volar and TypeScript Vue Plugin (Volar) for an optimal development experience.
- Type Support for .vue Imports in TS: TypeScript by default cannot handle type information for .vue imports, but elenext replaces the tsc CLI with vue-tsc for type checking. It also utilizes the TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.
- Take Over Mode (Performance Enhancement): If the standalone TypeScript plugin feels slow, elenext offers a “Take Over Mode” implemented in Volar that provides improved performance. This mode can be enabled by following specific steps.
Installation
To install elenext, follow these steps:
- Disable the built-in TypeScript Extension in Visual Studio Code.
- Run “Extensions: Show Built-in Extensions” from the command palette.
- Find “TypeScript and JavaScript Language Features”, right-click, and select “Disable (Workspace)”.
- Reload the Visual Studio Code window by running “Developer: Reload Window” from the command palette.
- Customize the configuration according to your project requirements using the Vite Configuration Reference.
- Set up your project using the provided instructions for compiling, hot-reloading for development, type-checking, compiling, and minifying for production, running unit tests with Vitest, and linting with ESLint.
Summary
elenext is a helpful template for Vue 3 development in Vite. It provides recommendations for IDE setup, enables type support for .vue imports in TypeScript, and offers a performance-enhancing mode. By following the installation guide, developers can quickly set up their projects and take advantage of elenext’s features.