nx/docs/shared/vite-plugin.md

898 B

The Nx plugin for Vite and Vitest.

{% callout type="warning" title="Early release plugin" %} This Nx plugin is in active development and may not be ready for real-world use. The planned release date for the stable plugin is December, 2022. {% /callout %}

Why should you use this plugin?

  • Instant dev server start
  • Lightning fast Hot-Module Reloading
  • Fast builds using Vite.
  • Vite-powered tests with smart and instant watch mode

Setting up Vite

To create a new workspace, run npx create-nx-workspace@latest --preset=npm.

To add the Vite plugin to an existing workspace, run the following:

{% tabs %} {% tab label="npm" %}

npm install -D @nrwl/vite

{% /tab %} {% tab label="yarn" %}

yarn add -D @nrwl/vite

{% /tab %} {% tab label="pnpm" %}

pnpm install -D @nrwl/vite

{% /tab %} {% /tabs %}