File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,34 @@ Now you can inject your service into your class::
198198 $this->render($emailTwo);
199199 }
200200
201+ Configuring the CSS Loader
202+ --------------------------
203+
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.
207+
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:
211+
212+ .. code-block :: javascript
213+
214+ // Configuring the CSS Loader in Webpack Encore
215+ // Prevent Webpack from resolving certain URLs in CSS files
216+ Encore .configureCssLoader ((options ) => {
217+ options .url = {
218+ filter : (url ) => {
219+ // Ignore URLs beginning with /uploads/
220+ if (url .startsWith (' /uploads/' )) {
221+ return false ;
222+ }
223+
224+ return true ; // Process other URLs as usual
225+ },
226+ };
227+ });
228+
201229 Generating a Webpack Configuration Object without using the Command-Line Interface
202230----------------------------------------------------------------------------------
203231
You can’t perform that action at this time.
0 commit comments