Symfony gives you the flexibility to choose any front-end tools you want. This could
be dead-simple - like putting CSS & JS directly in the
public/ directory - or
more advanced - like scaffolding your front-end with a tool like Next.js.
However, Symfony does come with two powerful options to help you build a modern, fast frontend, and enjoy the process:
- AssetMapper (recommended for new projects) runs entirely in PHP, doesn't require any build step and leverages modern web standards.
- Webpack Encore is built with Node.js on top of Webpack.
|Requires a build step?||no||yes|
|Works in all browsers?||yes||yes|
|Supports React, Vue, Svelte?||yes ||yes|
AssetMapper is the recommended system for handling your assets. It runs entirely
in PHP with no complex build step or dependencies. It does this by leveraging
importmap feature of your browser, which is available in all browsers thanks
to a polyfill.
Do you prefer video tutorials? Check out the Webpack Encore screencast series.
To learn about Stimulus & the UX Components, see: the StimulusBundle Documentation