{"id":20687,"library":"vite-plugin-symfony","title":"vite-plugin-symfony","description":"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.","status":"active","version":"8.2.4","language":"javascript","source_language":"en","source_url":"https://github.com/lhapaipai/vite-plugin-symfony","tags":["javascript","vite-plugin","vite plugin","vite","symfony","typescript"],"install":[{"cmd":"npm install vite-plugin-symfony","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-symfony","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-symfony","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for the plugin to function with Vite.","package":"vite","optional":false}],"imports":[{"note":"This is a Vite plugin, which are typically used as ES modules. CommonJS require may work in some setups but ES import is recommended.","wrong":"const symfonyPlugin = require('vite-plugin-symfony');","symbol":"default","correct":"import symfonyPlugin from 'vite-plugin-symfony';"},{"note":"SymfonyPluginOptions is a TypeScript interface, so it should be imported as a type to avoid runtime issues.","wrong":"import { SymfonyPluginOptions } from 'vite-plugin-symfony';","symbol":"SymfonyPluginOptions","correct":"import type { SymfonyPluginOptions } from 'vite-plugin-symfony';"},{"note":"The plugin is exported as default, not a named export. Named import will fail.","wrong":"import { symfonyPlugin } from 'vite-plugin-symfony';","symbol":"default export (named)","correct":"import symfonyPlugin from 'vite-plugin-symfony';"}],"quickstart":{"code":"// vite.config.js\nimport { defineConfig } from 'vite';\nimport symfonyPlugin from 'vite-plugin-symfony';\n\nexport default defineConfig({\n  plugins: [\n    symfonyPlugin(),\n  ],\n  build: {\n    rollupOptions: {\n      input: {\n        app: './assets/app.js',\n      },\n    },\n  },\n});","lang":"javascript","description":"Basic Vite configuration using vite-plugin-symfony with an entry point in assets/app.js."},"warnings":[{"fix":"Upgrade Vite to ^5.0.0 or ^6.0.0 (or higher).","message":"Version 8.x requires Vite 5 or higher. Vite 4 is no longer supported.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Use `import symfonyPlugin from 'vite-plugin-symfony'` instead of `import { createSymfonyPlugin } from 'vite-plugin-symfony'`.","message":"Default export changed from createSymfonyPlugin (v7) to default export (v8).","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Add rollupOptions.input to your Vite config.","message":"The plugin no longer automatically detects entry points; you must specify them in build.rollupOptions.input.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Run `composer require pentatrion/vite-bundle` and follow bundle configuration.","message":"Ensure that the Symfony bundle pentatrion/vite-bundle is installed in your Symfony project, otherwise the generated entrypoints.json will not be picked up.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install vite-plugin-symfony`.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'vite-plugin-symfony'"},{"fix":"Use `import symfonyPlugin from 'vite-plugin-symfony'` (default import).","cause":"Using named import instead of default import.","error":"TypeError: symfonyPlugin is not a function"},{"fix":"Ensure build.rollupOptions.input has a key (e.g., 'app') pointing to a valid entry file.","cause":"Missing or misconfigured input entry in build.rollupOptions.input.","error":"Error: Could not resolve entry module 'app'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}