File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -379,6 +379,17 @@ module.exports = function (webpackEnv) {
379379 // match the requirements. When no loader matches it will fall
380380 // back to the "file" loader at the end of the loader list.
381381 oneOf : [
382+ // TODO: Merge this config once `image/avif` is in the mime-db
383+ // https://github.com/jshttp/mime-db
384+ {
385+ test : [ / \. a v i f $ / ] ,
386+ loader : require . resolve ( 'url-loader' ) ,
387+ options : {
388+ limit : imageInlineSizeLimit ,
389+ mimetype : 'image/avif' ,
390+ name : 'static/media/[name].[hash:8].[ext]' ,
391+ } ,
392+ } ,
382393 // "url" loader works like "file" loader except that it embeds assets
383394 // smaller than specified limit in bytes as data URLs to avoid requests.
384395 // A missing `test` is equivalent to a match.
Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ declare namespace NodeJS {
99 }
1010}
1111
12+ declare module '*.avif' {
13+ const src : string ;
14+ export default src ;
15+ }
16+
1217declare module '*.bmp' {
1318 const src : string ;
1419 export default src ;
You can’t perform that action at this time.
0 commit comments