From 9f1126a20d310a9cc67969e536c6693c3e8614d3 Mon Sep 17 00:00:00 2001 From: mahalay Date: Thu, 16 Nov 2017 11:13:37 +0800 Subject: [PATCH 1/2] Simplify installation instruction when using npm --- frontend/encore/installation.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/encore/installation.rst b/frontend/encore/installation.rst index f49be2af0c9..396696dbd57 100644 --- a/frontend/encore/installation.rst +++ b/frontend/encore/installation.rst @@ -11,8 +11,11 @@ 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:: From 0793c50fca8093f0da4c8a9b81b157df0cc82910 Mon Sep 17 00:00:00 2001 From: anton Date: Thu, 16 Nov 2017 12:58:38 +0800 Subject: [PATCH 2/2] Reduce ambiguity of encore installation --- frontend/encore/installation.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/encore/installation.rst b/frontend/encore/installation.rst index 396696dbd57..e632559371e 100644 --- a/frontend/encore/installation.rst +++ b/frontend/encore/installation.rst @@ -19,12 +19,15 @@ Then, install Encore into your project with Yarn: .. 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.