Skip to content

Commit cc298b8

Browse files
committed
Minor reword
1 parent 4c94323 commit cc298b8

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

frontend/encore/advanced-config.rst

+10-8
Original file line numberDiff line numberDiff line change
@@ -201,25 +201,27 @@ Now you can inject your service into your class::
201201
Configuring the CSS Loader
202202
--------------------------
203203

204-
Encore provides the method ``configureCssLoader()`` to configure options for ``css-loader``. This method allows you to customize how Webpack processes CSS assets.
204+
Encore provides the ``configureCssLoader()`` method to customize how ``css-loader``
205+
processes your CSS assets. One common use case is to prevent Webpack from resolving
206+
certain URLs.
205207

206-
A common use case is filtering certain URLs so that Webpack does not attempt to resolve them. For example, if user-uploaded assets are stored under in a user uploaded directory, Webpack should not process these paths since they may not exist at build time.
207-
208-
Use ``configureCssLoader()`` as follows:
208+
For instance, if your application serves user-uploaded assets from a specific
209+
directory, you'll want Webpack to ignore these paths since they may not exist
210+
during the build process:
209211

210212
.. code-block:: javascript
211213
212214
// Configuring the CSS Loader in Webpack Encore
213-
// This ensures that Webpack does not attempt to resolve certain URLs in CSS files
214-
215+
// Prevent Webpack from resolving certain URLs in CSS files
215216
Encore.configureCssLoader((options) => {
216217
options.url = {
217218
filter: (url) => {
218-
// Ignore URLs that start with /uploads/
219+
// Ignore URLs beginning with /uploads/
219220
if (url.startsWith('/uploads/')) {
220221
return false;
221222
}
222-
return true; // Process other URLs normally
223+
224+
return true; // Process other URLs as usual
223225
},
224226
};
225227
});

0 commit comments

Comments
 (0)