Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf7ccacc

Browse files
committed
Merge branch '6.4' into 7.2
* 6.4: Backport 20755 pull request
2 parents3490683 +4150430 commitf7ccacc

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

‎frontend/encore/advanced-config.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
returnfalse;
222+
}
223+
224+
returntrue;// Process other URLs as usual
225+
},
226+
};
227+
});
228+
201229
Generating a Webpack Configuration Object without using the Command-Line Interface
202230
----------------------------------------------------------------------------------
203231

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp