Getting Started

    Compatibility Note

    Vite requires version >=12.0.0.

    With NPM:

    With Yarn:

    Then follow the prompts!

    Supported template presets include:

    • vue
    • vue-ts
    • react-ts
    • preact
    • preact-ts

    See @vitejs/create-app for more details on each template.

    In a project where Vite is installed, you can use the binary in your npm scripts, or run it directly with npx vite. Here is the default npm scripts in a scaffolded Vite project:

    You can specify additional CLI options like --port or --https. For a full list of CLI options, run npx vite --help in your project.

    Since Vite is a dev server, it has the concept of a “root directory” from which your files are served from, similar to a static file server (although much more powerful).

    Vite will serve when you open the server’s local address. It is also used as the default build entry point. Unlike some bundlers that treat HTML as an afterthought, Vite treats HTML files as part of the application graph (similar to Parcel). Therefore you should treat index.html as part of your source code instead of a static file. Vite also supports with multiple .html entry points.

    Vite will automatically pick up <root>/vite.config.js if there is one. You can also explicitly specify a config file to use via the --config <file> CLI option.

    Unlike a static file server, Vite can actually resolve and serve dependencies located anywhere on your file system, even if they are out of the project root. This allows Vite to work properly inside a sub package of a monorepo.

    If you can’t wait for a new release to test the latest features, you will need to clone the vite repo to your local machine and then build and link it yourself ( is required):

    Then go to your vite based project and run yarn link vite. Now restart the development server (yarn dev) to ride on the bleeding edge!