A Vite plugin that makes Vite support Electron (main, preload, renderer) and Node.js targets. Current stable version is 0.1.1 with no frequent releases; it provides a minimal, configuration-based approach to adapt Vite's build for non-browser environments. Its key differentiator is unified API for multiple targets, though alternative tools like electron-vite or vite-plugin-electron offer more comprehensive Electron support. The plugin is early-stage and may have limited community adoption.
npm install vite-plugin-targetVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of vite-plugin-target for Electron renderer with nodeIntegration enabled in Vite config.
Pin to exact version and check changelog before upgrading.
Set nodeIntegration: true or use alternative approach (e.g., preload with contextBridge).
Ensure Vite's build target and format are set appropriately (e.g., esm).
Update Vite to v3 or later: npm install vite@latest
Enable nodeIntegration in the target options or use preload script with contextBridge.
Install the package: npm install -D vite-plugin-target