From 71fd3b7306500df4394e6dc383bc531ea586472a Mon Sep 17 00:00:00 2001 From: Vincent Le Biannic <850046+Lyrkan@users.noreply.github.com> Date: Wed, 6 Mar 2019 20:02:28 +0100 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: Kocal --- frontend/encore/advanced-config.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/encore/advanced-config.rst b/frontend/encore/advanced-config.rst index d93bcb9fb23..85d242a2d8f 100644 --- a/frontend/encore/advanced-config.rst +++ b/frontend/encore/advanced-config.rst @@ -149,17 +149,17 @@ normally use from the command-line interface: Having the full control on Loaders Rules ---------------------------------------- -The method ``configureLoaderRule()`` provide a clean way to configure Webpack loaders rules (``module.rules``, see `Configuration `_). +The method ``configureLoaderRule()`` provides a clean way to configure Webpack loaders rules (``module.rules``, see `Configuration `_). -This is a low-level method. Any of your modifications will be applied just before pushing the loaders rules to Webpack. -It means that you can override configuration provided by Encore, so maybe you will break things. Be careful when using it. +This is a low-level method. All your modifications will be applied just before pushing the loaders rules to Webpack. +It means that you can override the default configuration provided by Encore, which may break things. Be careful when using it. A useful usage would be for configuring the ``eslint-loader`` to lint Vue files too. The following code is equivalent: .. code-block:: javascript - // Before + // Manually const webpackConfig = Encore.getWebpackConfig(); const eslintLoader = webpackConfig.module.rules.find(rule => rule.loader === 'eslint-loader'); @@ -167,7 +167,7 @@ The following code is equivalent: return webpackConfig; - // After + // Using Encore.configureLoaderRule() Encore.configureLoaderRule('eslint', loaderRule => { loaderRule.test = /\.(jsx?|vue)$/ });