Skip to content

Commit

Permalink
feat: add support for .cur type (#18680)
Browse files Browse the repository at this point in the history
Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
  • Loading branch information
otomad and sapphi-red authored Nov 19, 2024
1 parent f07e9b9 commit 5ec9eed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vite/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ declare module '*.avif' {
const src: string
export default src
}
declare module '*.cur' {
const src: string
export default src
}

// media
declare module '*.mp4' {
Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/node/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export const KNOWN_ASSET_TYPES = [
'ico',
'webp',
'avif',
'cur',

// media
'mp4',
Expand Down
2 changes: 2 additions & 0 deletions packages/vite/src/node/plugins/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export function registerCustomMime(): void {
// 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)
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
mrmime.mimes['flac'] = 'audio/flac'
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
Expand Down

0 comments on commit 5ec9eed

Please sign in to comment.