Skip to content

Commit 57b397c

Browse files
yuxi-ovosapphi-red
andauthored
feat: add support for .jxl (#18855)
Co-authored-by: 翠 / green <[email protected]>
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

+4
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

+1
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

+2
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)