You are browsing the Symfony 4 documentation, which changes significantly from Symfony 3.x. If your app doesn't use Symfony 4 yet, browse the Symfony 3.4 documentation.

Installing Encore (with Symfony Flex)

4.1 version
Maintained Unmaintained

Installing Encore (with Symfony Flex)ΒΆ


If your project does not use Symfony Flex, read Encore Installation (without Symfony Flex).

First, make sure you install Node.js and also the Yarn package manager. Then run:

$ composer require webpack-encore
$ yarn install

This will create a webpack.config.js file, add the assets/ directory, and add node_modules/ to .gitignore.

Nice work! Write your first JavaScript and CSS by reading Encore: Setting up your Project!

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.