Skip to content

Commit 175776c

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: Adding file-loader dependency.
2 parents c251a24 + 8dd9f3a commit 175776c

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

frontend/encore/copy-files.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Referencing Image files from a Template
2828

2929
To reference an image file from outside of a JavaScript file that's processed by
3030
Webpack - like a template - you can use the ``copyFiles()`` method to copy those
31-
files into your final output directory.
31+
files into your final output directory. First enable it in ``webpack.config.js``:
3232

3333
.. code-block:: diff
3434
@@ -51,6 +51,10 @@ files into your final output directory.
5151
+ //pattern: /\.(png|jpg|jpeg)$/
5252
+ })
5353
54+
Then restart Encore. When you do, it will give you a command you can run to
55+
install any missing dependencies. After running that command and restarting
56+
Encore, you're done!
57+
5458
This will copy all files from ``assets/images`` into ``public/build`` (the output
5559
path). If you have :doc:`versioning enabled <versioning>`, the copied files will
5660
include a hash based on their content.

frontend/encore/postcss.rst

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,26 @@ PostCSS and autoprefixing (postcss-loader)
44
`PostCSS`_ is a CSS post-processing tool that can transform your CSS in a lot
55
of cool ways, like `autoprefixing`_, `linting`_ and more!
66

7-
First, download ``postcss-loader`` and any plugins you want, like ``autoprefixer``:
7+
First enable it in ``webpack.config.js``:
8+
9+
.. code-block:: diff
10+
11+
// webpack.config.js
12+
13+
Encore
14+
// ...
15+
+ .enablePostCssLoader()
16+
;
17+
18+
Then restart Encore. When you do, it will give you a command you can run to
19+
install any missing dependencies. After running that command and restarting
20+
Encore, you're done!
21+
22+
Next, download any plugins you want, like ``autoprefixer``:
823

924
.. code-block:: terminal
1025
11-
$ yarn add postcss-loader autoprefixer --dev
26+
$ yarn add autoprefixer --dev
1227
1328
Next, create a ``postcss.config.js`` file at the root of your project:
1429

@@ -24,19 +39,6 @@ Next, create a ``postcss.config.js`` file at the root of your project:
2439
}
2540
}
2641
27-
Then, enable the loader in Encore!
28-
29-
.. code-block:: diff
30-
31-
// webpack.config.js
32-
33-
Encore
34-
// ...
35-
+ .enablePostCssLoader()
36-
;
37-
38-
Because you just modified ``webpack.config.js``, stop and restart Encore.
39-
4042
That's it! The ``postcss-loader`` will now be used for all CSS, Sass, etc files.
4143
You can also pass options to the `postcss-loader`_ by passing a callback:
4244

frontend/encore/reactjs.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Using React? First add some dependencies with Yarn:
1010

1111
.. code-block:: terminal
1212
13-
$ yarn add @babel/preset-react --dev
1413
$ yarn add react react-dom prop-types
1514
1615
Enable react in your ``webpack.config.js``:

0 commit comments

Comments
 (0)