Description
Hey,
I'm new to Symfony. I've just installed the symfony/website-skeleton
template with Flex and the first thing I wanted to add to the project was a build process for CSS/JS. I'm more a front-end dev than a backend programmer, I'm familiar with Grunt/Gulp/Webpack/Fusebox, etc so I could add any of these tools on my own, but I found that there's a tool like Encore so I decided to give it a try.
Thanks to docs I didn't have any problem with setting it up, but I found one detail that is missing in docs that might be very confusing for newcomers or for people who are not so familiar with modern front-end build tools.
For me, it was quite obvious that Webpack dev server serves compiled assets over HTTP and a Symfony application is able to point to these assets thanks to the manifest.json file and the Assets
component. It was also obvious that I have to run the Symfony web server and the Webpack dev server separately (in 2 separate console windows, or with php bin/console server:start && yarn run dev-server
). But the documentation is not very clear about it.
IMO it should be explicitly said that these are 2 separate tools. One might think that Encore is something that integrates with Symfony and running Symfony's web server would execute Webpack devs server under the hood. I know that it doesn't make much sense... but on the other beginner's guides should rather be explicit than making assumptions.
So IMO this part of the documentation needs some improvements... or maybe you could implement a feature like bin/console server:startWithDevServer
command that would start the Symfony's server in a background mode + Webpack dev server?