@@ -59,22 +59,29 @@ together and - thanks to the first ``app`` argument - output final ``app.js`` an
59
59
60
60
To build the assets, run:
61
61
62
- .. code-block :: terminal
62
+ .. configuration-block ::
63
+
64
+ .. code-block :: terminal
65
+
66
+ # compile assets once
67
+ $ yarn encore dev
68
+
69
+ # or, recompile assets automatically when files change
70
+ $ yarn encore dev --watch
71
+
72
+ # on deploy, create a production build
73
+ $ yarn encore production
63
74
64
- # compile assets once
65
- $ yarn encore dev
66
- # if you prefer npm, run:
67
- $ npm run dev
75
+ .. code-block :: terminal
68
76
69
- # or, recompile assets automatically when files change
70
- $ yarn encore dev --watch
71
- # if you prefer npm, run:
72
- $ npm run watch
77
+ # compile assets once
78
+ $ npm run dev
73
79
74
- # on deploy, create a production build
75
- $ yarn encore production
76
- # if you prefer npm, run:
77
- $ npm run build
80
+ # or, recompile assets automatically when files change
81
+ $ npm run watch
82
+
83
+ # on deploy, create a production build
84
+ $ npm run build
78
85
79
86
.. note ::
80
87
@@ -159,9 +166,15 @@ files. First, create a file that exports a function:
159
166
160
167
We'll use jQuery to print this message on the page. Install it via:
161
168
162
- .. code-block :: terminal
169
+ .. configuration-block ::
170
+
171
+ .. code-block :: terminal
172
+
173
+ $ yarn add jquery --dev
174
+
175
+ .. code-block :: terminal
163
176
164
- $ yarn add jquery --dev
177
+ $ npm install jquery --save -dev
165
178
166
179
Great! Use ``require() `` to import ``jquery `` and ``greet.js ``:
167
180
@@ -251,9 +264,16 @@ Next, use ``addEntry()`` to tell Webpack to read these two new files when it bui
251
264
And because you just changed the ``webpack.config.js `` file, make sure to stop
252
265
and restart Encore:
253
266
254
- .. code-block :: terminal
255
267
256
- $ yarn run encore dev --watch
268
+ .. configuration-block ::
269
+
270
+ .. code-block :: terminal
271
+
272
+ $ yarn run encore dev --watch
273
+
274
+ .. code-block :: terminal
275
+
276
+ $ npm run watch
257
277
258
278
Webpack will now output a new ``checkout.js `` file and a new ``account.js `` file
259
279
in your build directory. And, if any of those files require/import CSS, Webpack
@@ -320,10 +340,17 @@ Encore. When you do, you'll see an error!
320
340
Encore supports many features. But, instead of forcing all of them on you, when
321
341
you need a feature, Encore will tell you what you need to install. Run:
322
342
323
- .. code-block :: terminal
343
+ .. configuration-block ::
344
+
345
+ .. code-block :: terminal
346
+
347
+ $ yarn add sass-loader@^10.0.0 sass --dev
348
+ $ yarn encore dev --watch
349
+
350
+ .. code-block :: terminal
324
351
325
- $ yarn add sass-loader@^10.0.0 sass --dev
326
- $ yarn encore dev -- watch
352
+ $ npm install sass-loader@^10.0.0 sass --save -dev
353
+ $ npm run watch
327
354
328
355
Your app now supports Sass. Encore also supports LESS and Stylus. See
329
356
:doc: `/frontend/encore/css-preprocessors `.
0 commit comments