symfony / reprise
Integrate Vite and Rsbuild with Symfony, a reprise of Webpack Encore Bundle.
Package info
Type:symfony-bundle
pkg:composer/symfony/reprise
Requires
- php: >=8.4
- symfony/asset: ^7.4|^8.0
- symfony/config: ^7.4|^8.0
- symfony/dependency-injection: ^7.4|^8.0
- symfony/event-dispatcher: ^7.4|^8.0
- symfony/http-foundation: ^7.4|^8.0
- symfony/http-kernel: ^7.4|^8.0
- symfony/service-contracts: ^3
- twig/twig: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^13.2
- shipmonk/composer-dependency-analyser: ^1.8
- symfony/cache: ^7.4|^8.0
- symfony/error-handler: ^7.4|^8.0
- symfony/framework-bundle: ^7.4|^8.0
- symfony/web-link: ^7.4|^8.0
README
Symfony Reprise: Webpack Encore's heritage, for modern bundlers
Webpack Encore gave Symfony first-class asset integration for Webpack.
Symfony Reprise brings the same to Vite and Rsbuild.
π£ Read the announcement blog post
Warning
Experimental this bundle is experimental and is likely to change, or even change drastically.
Symfony Reprise covers only the Symfony-side glue the bundlers leave out:
- π― Multiple entries: build several independent entry points from one config
- π
entrypoints.json: generated in both build and dev-server modes - πΊοΈ
manifest.json: maps each logical filename to its hashed URL - π Asset versioning: content-hash cache busting, wired into the manifest
- π File copy: copy static files (images, fontsβ¦) into the build, keyed in the manifest
- π₯ Dev server & HMR: points Twig at the running Vite/Rsbuild server
- π§± Multiple builds: drive several bundles (e.g. a main app and a separately-built embeddable widget) from one Symfony app
- π·οΈ Twig tag rendering:
reprise_entry_script_tags/reprise_entry_link_tagsrender straight fromentrypoints.json - π§© Symfony UX / Stimulus: registers
controllers.jsonand local controllers, eager or lazy - π CDN support: serve built assets from an absolute
publicPath - π‘οΈ Subresource Integrity: SRI hashes in
entrypoints.json - π Customizable tag attributes:
RenderAssetTagEventlets listeners add, change or remove attributes on every rendered tag (e.g. a CSP nonce)
Vite and Rsbuild already handle Sass/Less/PostCSS, TypeScript, JSX/Vue/Svelte, code splitting, content hashing, source maps, minification and HMR on their own, so Symfony Reprise does not reimplement any of that.
It generates the Encore-compatible entrypoints.json and manifest.json that Reprise's own Symfony bundle (RepriseBundle) reads to render the <script> and <link> tags, wires up the native dev server, and turns your Stimulus controllers into a running application.