Skip to content

Commit 71fd3b7

Browse files
LyrkanKocal
andauthored
Apply suggestions from code review
Co-Authored-By: Kocal <kocal@live.fr>
1 parent c02322c commit 71fd3b7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

frontend/encore/advanced-config.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,25 +149,25 @@ normally use from the command-line interface:
149149
Having the full control on Loaders Rules
150150
----------------------------------------
151151

152-
The method ``configureLoaderRule()`` provide a clean way to configure Webpack loaders rules (``module.rules``, see `Configuration <https://webpack.js.org/concepts/loaders/#configuration>`_).
152+
The method ``configureLoaderRule()`` provides a clean way to configure Webpack loaders rules (``module.rules``, see `Configuration <https://webpack.js.org/concepts/loaders/#configuration>`_).
153153

154-
This is a low-level method. Any of your modifications will be applied just before pushing the loaders rules to Webpack.
155-
It means that you can override configuration provided by Encore, so maybe you will break things. Be careful when using it.
154+
This is a low-level method. All your modifications will be applied just before pushing the loaders rules to Webpack.
155+
It means that you can override the default configuration provided by Encore, which may break things. Be careful when using it.
156156

157157
A useful usage would be for configuring the ``eslint-loader`` to lint Vue files too.
158158
The following code is equivalent:
159159

160160
.. code-block:: javascript
161161
162-
// Before
162+
// Manually
163163
const webpackConfig = Encore.getWebpackConfig();
164164
165165
const eslintLoader = webpackConfig.module.rules.find(rule => rule.loader === 'eslint-loader');
166166
eslintLoader.test = /\.(jsx?|vue)$/;
167167
168168
return webpackConfig;
169169
170-
// After
170+
// Using Encore.configureLoaderRule()
171171
Encore.configureLoaderRule('eslint', loaderRule => {
172172
loaderRule.test = /\.(jsx?|vue)$/
173173
});

0 commit comments

Comments
 (0)