1
1
Installing Encore
2
2
=================
3
3
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.
10
6
11
7
Installing Encore in Symfony Applications
12
8
-----------------------------------------
@@ -17,11 +13,6 @@ project:
17
13
.. code-block :: terminal
18
14
19
15
$ 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
25
16
$ npm install
26
17
27
18
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.
36
27
Installing Encore in non Symfony Applications
37
28
---------------------------------------------
38
29
39
- Install Encore into your project via Yarn :
30
+ Install Encore into your project via npm :
40
31
41
32
.. code-block :: terminal
42
33
43
- # if you use the Yarn package manager
44
- $ yarn add @symfony/webpack-encore --dev
45
-
46
- # if you use the npm package manager
47
34
$ npm install @symfony/webpack-encore --save-dev
48
35
49
36
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.
52
38
53
39
.. tip ::
54
40
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/ ``.
57
43
58
44
Creating the webpack.config.js File
59
45
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -223,5 +209,4 @@ on which features of Encore you have enabled.
223
209
:doc: `split chunks </frontend/encore/split-chunks >`.
224
210
225
211
.. _`install Node.js` : https://nodejs.org/en/download/
226
- .. _`Yarn package manager` : https://yarnpkg.com/getting-started/install
227
212
.. _`WebpackEncoreBundle` : https://github.com/symfony/webpack-encore-bundle
0 commit comments