Django plugin for Vite (v4.1.2) — integrates Vite frontend assets with Django backend. Release cadence: active, monthly releases. Key differentiators: uses Python side django-vite-plugin pip package, supports Vite 5/6/7, handles HMR, React support, and aliases. Alternative to django-vite and django-webpack-loader.
npm install django-vite-pluginVerified import paths — ran on the pinned version, not inferred.
Sets up Vite with Django plugin: specifies entry points, output directory, manifest, and dev server port.
Update to new signature: djangoVitePlugin(['entry1.js', 'entry2.css'], { ... })Ensure all entry points are passed to djangoVitePlugin() array.
Use 'build.outDir' in Vite config instead of plugin option 'outputDir'.
Ensure you have '@vitejs/plugin-react' installed and configured alongside djangoVitePlugin.
Set 'type': 'module' in package.json or rename config to .mjs
Use import.meta.url to derive __dirname: const __dirname = dirname(fileURLToPath(import.meta.url)); or avoid __dirname entirely.
Change to: import { djangoVitePlugin } from 'django-vite-plugin'Run: npm install django-vite-plugin
Run 'vite build' to generate manifest, and ensure Vite config has build.manifest: true.