@@ -358,22 +358,30 @@ module.exports = function (webpackEnv) {
358
358
// https://github.com/jshttp/mime-db
359
359
{
360
360
test : [ / \. a v i f $ / ] ,
361
- loader : require . resolve ( 'url-loader' ) ,
362
- options : {
363
- limit : imageInlineSizeLimit ,
364
- mimetype : 'image/avif' ,
365
- name : 'static/media/[name].[hash:8].[ext]' ,
361
+ type : 'asset' ,
362
+ mimetype : 'image/avif' ,
363
+ generator : {
364
+ filename : 'static/media/[hash][ext][query]' ,
365
+ } ,
366
+ parser : {
367
+ dataUrlCondition : {
368
+ maxSize : imageInlineSizeLimit ,
369
+ } ,
366
370
} ,
367
371
} ,
368
372
// "url" loader works like "file" loader except that it embeds assets
369
373
// smaller than specified limit in bytes as data URLs to avoid requests.
370
374
// A missing `test` is equivalent to a match.
371
375
{
372
376
test : [ / \. b m p $ / , / \. g i f $ / , / \. j p e ? g $ / , / \. p n g $ / ] ,
373
- loader : require . resolve ( 'url-loader' ) ,
374
- options : {
375
- limit : imageInlineSizeLimit ,
376
- name : 'static/media/[name].[hash:8].[ext]' ,
377
+ type : 'asset' ,
378
+ generator : {
379
+ filename : 'static/media/[hash][ext][query]' ,
380
+ } ,
381
+ parser : {
382
+ dataUrlCondition : {
383
+ maxSize : imageInlineSizeLimit ,
384
+ } ,
377
385
} ,
378
386
} ,
379
387
// Process application JS with Babel.
@@ -558,14 +566,14 @@ module.exports = function (webpackEnv) {
558
566
// This loader doesn't use a "test" so it will catch all modules
559
567
// that fall through the other loaders.
560
568
{
561
- loader : require . resolve ( 'file-loader' ) ,
562
569
// Exclude `js` files to keep "css" loader working as it injects
563
570
// its runtime that would otherwise be processed through "file" loader.
564
571
// Also exclude `html` and `json` extensions so they get processed
565
572
// by webpacks internal loaders.
566
573
exclude : [ / \. ( j s | m j s | j s x | t s | t s x ) $ / , / \. h t m l $ / , / \. j s o n $ / ] ,
567
- options : {
568
- name : 'static/media/[name].[hash:8].[ext]' ,
574
+ type : 'asset/resource' ,
575
+ generator : {
576
+ filename : 'static/media/[hash][ext][query]' ,
569
577
} ,
570
578
} ,
571
579
// ** STOP ** Are you adding a new loader?
0 commit comments