Vite Tsconfig Paths

Getting Started Overview Vite (French word for "quick", pronounced /vit/, like "veet") is a build tool that aims to provide a faster and leaner development experience for modern web projects. It consists of two major parts: A dev server that provides rich feature enhancements over native ES modules, for example extremely fast Hot Module Replacement (HMR). A build command that bundles your code ...

Next Generation Frontend Tooling This documentation covers Vite 3 (old version). For the latest version, see https://vite.dev.

vite tsconfig paths 2

Next Generation Frontend Tooling This documentation covers Vite 2 (old version). For the latest version, see https://vite.dev.

vite tsconfig paths 3

Vite aims to address these issues by leveraging new advancements in the ecosystem: the availability of native ES modules in the browser, and the rise of JavaScript tools written in compile-to-native languages.

vite tsconfig paths 4

Vite's current plugin API isn't compatible with using esbuild as a bundler. In spite of esbuild being faster, Vite's adoption of Rollup's flexible plugin API and infrastructure heavily contributed to its success in the ecosystem. For the time being, we believe that Rollup offers a better performance-vs-flexibility tradeoff.

Configuring Vite Config File Config File Resolving When running vite from the command line, Vite will automatically try to resolve a config file named vite.config.js inside project root. The most basic config file looks like this:

vite tsconfig paths 6

The Vite team partners with the main projects in the ecosystem to test new Vite versions before they are released through the vite-ecosystem-ci project. Most projects using Vite should be able to quickly offer support or migrate to new versions as soon as they are released.

Features At the very basic level, developing using Vite is not that much different from using a static file server. However, Vite provides many enhancements over native ESM imports to support various features that are typically seen in bundler-based setups. NPM Dependency Resolving and Pre-Bundling Native ES imports do not support bare module imports like the following:

vite tsconfig paths 8