
Vite also supports multi-page apps with multiple. Vite is also capable of handling dependencies that resolve to out-of-root file system locations, which makes it usable even in a monorepo-based setup.
Scaffold builder code#
Absolute URLs in your source code will be resolved using the project root as base, so you can write code as if you are working with a normal static file server (except way more powerful!). You will see it referenced as throughout the rest of the docs. Similar to static http servers, Vite has the concept of a "root directory" which your files are served from. In addition, URLs inside index.html are automatically rebased so there's no need for special %PUBLIC_URL% placeholders. Even inline and CSS referenced via also enjoy Vite-specific features. It resolves that references your JavaScript source code. Vite treats index.html as source code and part of the module graph. This is intentional: during development Vite is a server, and index.html is the entry point to your application. One thing you may have noticed is that in a Vite project, index.html is front-and-central instead of being tucked away inside public. The supported template presets are: JavaScriptīash npx degit user/project#main my-project index.html and Project Root You can navigate to vite.new/ to select which framework to use. It runs the Vite-based build setup directly in the browser, so it is almost identical to the local setup but doesn't require installing anything on your machine. Legacy browsers can be supported via the official - see the Building for Production section for more details.

The default build targets browsers that support native ES Modules, native ESM dynamic import, and i ta. You can learn more about the rationale behind the project in the Why Vite section.
Scaffold builder full#
Vite is opinionated and comes with sensible defaults out of the box, but is also highly extensible via its Plugin API and JavaScript API with full typing support. It consists of two major parts:Ī dev server that provides rich feature enhancements over native ES modules, for example extremely fast Hot Module Replacement (HMR).Ī build command that bundles your code with Rollup, pre-configured to output highly optimized static assets for production. 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.
