Skip to content

Simplify installation instruction when using npm #8673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions frontend/encore/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,23 @@ Then, install Encore into your project with Yarn:

.. note::

If you want to use `npm`_ instead of `yarn`_, replace ``yarn add xxx --dev`` by
``npm install xxx --save-dev``.
If you want to use `npm`_ instead of `yarn`_:

.. code-block:: terminal

$ npm install @symfony/webpack-encore --save-dev

.. tip::

If you are using Flex for your project, you can install Encore via:
If you are using Flex for your project, you can initialize your project for Encore via:

.. code-block:: terminal

$ composer require encore

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

This command creates (or modifies) a ``package.json`` file and downloads dependencies
into a ``node_modules/`` directory. When using Yarn, a file called ``yarn.lock``
is also created/updated. When using npm 5, a ``package-lock.json`` file is created/updated.
Expand Down