11Installing Encore
22=================
33
4- First, make sure you `install Node.js `_. Optionally you can also install the
5- `Yarn package manager `_. In the next sections you will always see the commands
6- for both ``npm `` and ``yarn ``, but you only need to run one of them.
7-
8- The following instructions depend on whether you are installing Encore in a
9- Symfony application or not.
4+ First, make sure you `install Node.js `_. Then, follow the instructions below,
5+ which depend on whether you are installing Encore in a Symfony application or not.
106
117Installing Encore in Symfony Applications
128-----------------------------------------
@@ -17,11 +13,6 @@ project:
1713.. code-block :: terminal
1814
1915 $ composer require symfony/webpack-encore-bundle
20-
21- # if you use the Yarn package manager
22- $ yarn install
23-
24- # if you use the npm package manager
2516 $ npm install
2617
2718 If you are using :ref: `Symfony Flex <symfony-flex >`, this will install and enable
@@ -36,24 +27,19 @@ and files by yourself following the instructions shown in the next section.
3627Installing Encore in non Symfony Applications
3728---------------------------------------------
3829
39- Install Encore into your project via Yarn :
30+ Install Encore into your project via npm :
4031
4132.. code-block :: terminal
4233
43- # if you use the Yarn package manager
44- $ yarn add @symfony/webpack-encore --dev
45-
46- # if you use the npm package manager
4734 $ npm install @symfony/webpack-encore --save-dev
4835
4936 This command creates (or modifies) a ``package.json `` file and downloads
50- dependencies into a ``node_modules/ `` directory. Yarn also creates/updates a
51- ``yarn.lock `` (called ``package-lock.json `` if you use npm).
37+ dependencies into a ``node_modules/ `` directory.
5238
5339.. tip ::
5440
55- You *should * commit ``package.json `` and ``yarn.lock `` (or `` package-lock.json ``
56- if using npm) to version control, but ignore ``node_modules/ ``.
41+ You *should * commit ``package.json `` and ``package-lock.json ``
42+ to version control, but ignore ``node_modules/ ``.
5743
5844Creating the webpack.config.js File
5945~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -223,5 +209,4 @@ on which features of Encore you have enabled.
223209 :doc: `split chunks </frontend/encore/split-chunks >`.
224210
225211.. _`install Node.js` : https://nodejs.org/en/download/
226- .. _`Yarn package manager` : https://yarnpkg.com/getting-started/install
227212.. _`WebpackEncoreBundle` : https://github.com/symfony/webpack-encore-bundle
0 commit comments