Registry / devops / nx-plugin-vite

nx-plugin-vite

JSON →
library2.2.1jsnpmunverified

A Nx plugin for integrating Vite into Nx monorepos. Current version 2.2.1 supports Vite ^2.7.10. Enables Nx generators, executors, and build caching for Vite projects. Key differentiator: provides Nx-native Vite support with monorepo optimizations, unlike manual Vite setup.

npm install nx-plugin-vite
INSTALL
IMPORT
SIG · NX-PLUGIN-VITE
N
nx-plugin-vite
devopsjavascriptv2.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

i
import { i } from '@nx-vite/plugin'
import { i } from 'nx-plugin-vite'
Correct import path uses scoped package name.
default
import plugin from '@nx-vite/plugin'
require('nx-plugin-vite')
ESM-only; CommonJS require is not supported.
type ViteConfiguration
import type { ViteConfiguration } from '@nx-vite/plugin'
import { ViteConfiguration } from '@nx-vite/plugin'
Type-only import to avoid runtime side effects.

Shows installation, configuration in Nx workspace, project generation, and build execution using the Vite plugin.

// Install the plugin npm install --save-dev @nx-vite/plugin // Add plugin to workspace.json or project.json "plugins": [ { "plugin": "@nx-vite/plugin", "options": { "buildTargetName": "build", "serveTargetName": "serve" } } ] // Generate a new Vite project npx nx generate @nx-vite/plugin:vite-project my-app // Build the project npx nx build my-app
Debug
Known issues
breakingPeer dependency vite must be ^2.7.10; using other versions may cause incompatible plugin APIs.
fix
Install vite@^2.7.10: npm install vite@^2.7.10 --save-dev
affects: >=2.0.0
deprecatedThe generator `vite-app` may be replaced with `vite-project` in future releases.
fix
Use `vite-project` generator if available.
affects: >=2.0.0 <3.0.0
gotchaEnsure Nx workspace is configured with `plugins` array, not just `tasksRunnerOptions`.
fix
Add plugin config to `nx.json` or `project.json` as shown in quickstart.
affects: >=1.0.0
Errors
Common errors & fixes
Module not found: Error: Can't resolve '@nx-vite/plugin' in '/workspace'
Package not installed or wrong import path.
fix
Install the plugin: npm install --save-dev @nx-vite/plugin
Could not find plugin '@nx-vite/plugin'. Check that it is installed and added to nx.json.
Plugin not registered in Nx configuration.
fix
Add plugin entry to `plugins` array in nx.json or project.json.
Error: Cannot find module 'vite'
Missing peer dependency vite.
fix
Install vite: npm install --save-dev vite@^2.7.10
Upgrade
Version history
2.2.1latest on npm
Audit
Dependencies
viterequiredpeer dependency for build tooling
Agent activity
2 hits · last 30 days
node
2
Resources
nx-plugin-vite — npm install nx-plugin-vite · libregistry