Skip to content

Commit 57b397c

Browse files
yuxi-ovosapphi-red
andauthored
feat: add support for .jxl (#18855)
Co-authored-by: 翠 / green <green@sapphi.red>
1 parent c9a4b7a commit 57b397c

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

packages/vite/client.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ declare module '*.cur' {
106106
const src: string
107107
export default src
108108
}
109+
declare module '*.jxl' {
110+
const src: string
111+
export default src
112+
}
109113

110114
// media
111115
declare module '*.mp4' {

packages/vite/src/node/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export const KNOWN_ASSET_TYPES = [
133133
'webp',
134134
'avif',
135135
'cur',
136+
'jxl',
136137

137138
// media
138139
'mp4',

packages/vite/src/node/plugins/asset.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ export function registerCustomMime(): void {
5757
mrmime.mimes['flac'] = 'audio/flac'
5858
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
5959
mrmime.mimes['eot'] = 'application/vnd.ms-fontobject'
60+
// https://github.com/lukeed/mrmime/issues/10
61+
mrmime.mimes['jxl'] = 'image/jxl'
6062
}
6163

6264
export function renderAssetUrlInJS(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy