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.
Then, install Encore into your project with Yarn:
$ yarn add @symfony/webpack-encore --dev
If you are using Flex for your project, you can initialize your project for Encore via:
$ composer require encore $ yarn install
This will create a
webpack.config.js file, add the
assets/ directory, and add
This command creates (or modifies) a
package.json file and downloads dependencies
node_modules/ directory. When using Yarn, a file called
is also created/updated. When using npm 5, a
package-lock.json file is created/updated.
You should commit
if using npm 5) to version control, but ignore
Next, create your
webpack.config.js in First Example!
This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.