@@ -55,23 +55,33 @@ together and - thanks to the first ``app`` argument - output final ``app.js`` an
55
55
56
56
.. _encore-build-assets :
57
57
58
- To build the assets, run:
58
+ To build the assets, run the following if you use the Yarn package manager :
59
59
60
60
.. code-block :: terminal
61
61
62
62
# compile assets once
63
63
$ yarn encore dev
64
- # if you prefer npm, run:
65
- $ npm run dev
66
64
67
65
# or, recompile assets automatically when files change
68
66
$ yarn encore dev --watch
69
- # if you prefer npm, run:
70
- $ npm run watch
71
67
72
68
# on deploy, create a production build
73
69
$ 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
75
85
$ npm run build
76
86
77
87
.. note ::
@@ -161,8 +171,12 @@ We'll use jQuery to print this message on the page. Install it via:
161
171
162
172
.. code-block :: terminal
163
173
174
+ # if you use the Yarn package manager
164
175
$ yarn add jquery --dev
165
176
177
+ # if you use the npm package manager
178
+ $ npm install jquery --save-dev
179
+
166
180
Great! Use ``import `` to import ``jquery `` and ``greet.js ``:
167
181
168
182
.. code-block :: diff
@@ -222,8 +236,12 @@ and restart Encore:
222
236
223
237
.. code-block :: terminal
224
238
239
+ # if you use the Yarn package manager
225
240
$ yarn run encore dev --watch
226
241
242
+ # if you use the npm package manager
243
+ $ npm run watch
244
+
227
245
Webpack will now output a new ``checkout.js `` file and a new ``account.js `` file
228
246
in your build directory. And, if any of those files require/import CSS, Webpack
229
247
will *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:
291
309
292
310
.. code-block :: terminal
293
311
312
+ # if you use the Yarn package manager
294
313
$ yarn add sass-loader@^10.0.0 sass --dev
295
314
$ yarn encore dev --watch
296
315
316
+ # if you use the npm package manager
317
+ $ npm install sass-loader@^10.0.0 sass --save-dev
318
+ $ npm run watch
319
+
297
320
Your app now supports Sass. Encore also supports LESS and Stylus. See
298
321
:doc: `/frontend/encore/css-preprocessors `.
299
322
0 commit comments