feat: add support for .cur type (#18680)

Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
This commit is contained in:
Rantetsu Inori 2024-11-19 14:18:07 +08:00 committed by GitHub
parent f07e9b9d01
commit 5ec9eedc80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 0 deletions

View File

@ -102,6 +102,10 @@ declare module '*.avif' {
const src: string const src: string
export default src export default src
} }
declare module '*.cur' {
const src: string
export default src
}
// media // media
declare module '*.mp4' { declare module '*.mp4' {

View File

@ -132,6 +132,7 @@ export const KNOWN_ASSET_TYPES = [
'ico', 'ico',
'webp', 'webp',
'avif', 'avif',
'cur',
// media // media
'mp4', 'mp4',

View File

@ -51,6 +51,8 @@ export function registerCustomMime(): void {
// instead of `image/vnd.microsoft.icon` which is registered on IANA Media Types DB // instead of `image/vnd.microsoft.icon` which is registered on IANA Media Types DB
// image/x-icon should be used instead for better compatibility (https://github.com/h5bp/html5-boilerplate/issues/219) // image/x-icon should be used instead for better compatibility (https://github.com/h5bp/html5-boilerplate/issues/219)
mrmime.mimes['ico'] = 'image/x-icon' mrmime.mimes['ico'] = 'image/x-icon'
// https://mimesniff.spec.whatwg.org/#matching-an-image-type-pattern
mrmime.mimes['cur'] = 'image/x-icon'
// https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers#flac // https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers#flac
mrmime.mimes['flac'] = 'audio/flac' mrmime.mimes['flac'] = 'audio/flac'
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types