Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add an explanation how to run Symfony server together with Webpack dev server #9331

Copy link
Copy link
Closed
@wujekbogdan

Description

@wujekbogdan
Issue body actions

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    front-endhasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.