A Vite plugin for integrating Vite into Symfony applications. Current stable version is 8.2.4. It generates an entrypoints.json file with JS/CSS/preload dependencies and supports browser reload on Twig file changes. This plugin is designed to be used with the pentatrion/vite-bundle Symfony bundle. It supports Vite versions 3 through 8, making it compatible with modern Vite setups. Unlike generic Vite-Symfony integrations, this package offers a dedicated ecosystem with a Symfony bundle and active maintenance.
npm install vite-plugin-symfonyVerified import paths — ran on the pinned version, not inferred.
Basic Vite configuration using vite-plugin-symfony with an entry point in assets/app.js.
Upgrade Vite to ^5.0.0 or ^6.0.0 (or higher).
Use `import symfonyPlugin from 'vite-plugin-symfony'` instead of `import { createSymfonyPlugin } from 'vite-plugin-symfony'`.Add rollupOptions.input to your Vite config.
Run `composer require pentatrion/vite-bundle` and follow bundle configuration.
Run `npm install vite-plugin-symfony`.
Use `import symfonyPlugin from 'vite-plugin-symfony'` (default import).
Ensure build.rollupOptions.input has a key (e.g., 'app') pointing to a valid entry file.