@@ -55,23 +55,33 @@ together and - thanks to the first ``app`` argument - output final ``app.js`` an
5555
5656.. _encore-build-assets :
5757
58- To build the assets, run:
58+ To build the assets, run the following if you use the Yarn package manager :
5959
6060.. code-block :: terminal
6161
6262 # compile assets once
6363 $ yarn encore dev
64- # if you prefer npm, run:
65- $ npm run dev
6664
6765 # or, recompile assets automatically when files change
6866 $ yarn encore dev --watch
69- # if you prefer npm, run:
70- $ npm run watch
7167
7268 # on deploy, create a production build
7369 $ yarn encore production
74- # if you prefer npm, run:
70+
71+ # if you use the npm package manager
72+ $ npm install react react-dom prop-types --save
73+
74+ If you use the npm package manager, run the following commands instead:
75+
76+ .. code-block :: terminal
77+
78+ # compile assets once
79+ $ npm run dev
80+
81+ # or, recompile assets automatically when files change
82+ $ npm run watch
83+
84+ # on deploy, create a production build
7585 $ npm run build
7686
7787 .. note ::
@@ -161,8 +171,12 @@ We'll use jQuery to print this message on the page. Install it via:
161171
162172.. code-block :: terminal
163173
174+ # if you use the Yarn package manager
164175 $ yarn add jquery --dev
165176
177+ # if you use the npm package manager
178+ $ npm install jquery --save-dev
179+
166180 Great! Use ``import `` to import ``jquery `` and ``greet.js ``:
167181
168182.. code-block :: diff
@@ -222,8 +236,12 @@ and restart Encore:
222236
223237.. code-block :: terminal
224238
239+ # if you use the Yarn package manager
225240 $ yarn run encore dev --watch
226241
242+ # if you use the npm package manager
243+ $ npm run watch
244+
227245 Webpack will now output a new ``checkout.js `` file and a new ``account.js `` file
228246in your build directory. And, if any of those files require/import CSS, Webpack
229247will *also * output ``checkout.css `` and ``account.css `` files.
@@ -291,9 +309,14 @@ you need a feature, Encore will tell you what you need to install. Run:
291309
292310.. code-block :: terminal
293311
312+ # if you use the Yarn package manager
294313 $ yarn add sass-loader@^10.0.0 sass --dev
295314 $ yarn encore dev --watch
296315
316+ # if you use the npm package manager
317+ $ npm install sass-loader@^10.0.0 sass --save-dev
318+ $ npm run watch
319+
297320 Your app now supports Sass. Encore also supports LESS and Stylus. See
298321:doc: `/frontend/encore/css-preprocessors `.
299322
0 commit comments