vite-plus

raw JSON →
0.1.19 verified Mon Apr 27 auth: no javascript

vite-plus is a unified toolchain for web development, currently at v0.1.19 stable with frequent alpha releases (v0.1.20-alpha.3). It wraps Vite and provides additional CLIs for linting, formatting, and testing, with features like lazy plugin loading and Windows terminal fixes. Differentiators: it offers a single setup script, built-in lint/check commands, and lazy loading to improve build performance. Requires Node.js ^20.19.0 || >=22.12.0.

error Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
cause Using require() to import an ESM-only package
fix
Switch to ESM imports: import { defineConfig } from 'vite-plus'
error Module not found: Can't resolve 'vite-plus/plugin'
cause Missing subpath exports in older versions; fixed in v0.1.19
fix
Upgrade to vite-plus@^0.1.19 or use import from 'vite-plus' if available
error Error: Unknown command 'vite-plus'
cause CLI renamed from 'vite-plus' to 'vp' in v0.1.18
fix
Use 'vp' command instead of 'vite-plus'
breaking Node.js <20.19.0 or <22.12.0 not supported
fix Upgrade Node.js to ^20.19.0 or >=22.12.0
breaking CLI changed from 'vite-plus' command to 'vp' command in v0.1.18
fix Use 'vp' instead of 'vite-plus' in terminal; update scripts accordingly.
gotcha lazyPlugins must be imported from 'vite-plus/plugin', not 'vite-plus'
fix Change import to: import { lazyPlugins } from 'vite-plus/plugin'
deprecated CommonJS require() of vite-plus will throw in Node ESM mode
fix Use ESM imports or set 'type': 'module' in package.json
npm install vite-plus
yarn add vite-plus
pnpm add vite-plus

Creates a vite-plus config using lazy loaded Vue plugin, demonstrating lazyPlugins usage.

import { defineConfig } from 'vite-plus';
import { lazyPlugins } from 'vite-plus/plugin';

export default defineConfig({
  plugins: [
    lazyPlugins(() => import('@vitejs/plugin-vue'), { include: /\\.vue$/ }),
  ],
  build: {
    outDir: 'dist',
  },
});