Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for .cur type #18680

Merged
merged 3 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -130,6 +130,7 @@ export const KNOWN_ASSET_TYPES = [
'ico',
'webp',
'avif',
'cur',

// media
'mp4',
Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/node/plugins/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const cssEntriesMap = new WeakMap<Environment, Set<string>>()
export function registerCustomMime(): void {
// https://github.com/lukeed/mrmime/issues/3
mrmime.mimes['ico'] = 'image/x-icon'
mrmime.mimes['cur'] = 'image/x-icon'
Copy link
Member

@sapphi-red sapphi-red Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this as the mime type was missing.

I used image/x-icon as this was the only mime type I found on a spec or some standards.
https://mimesniff.spec.whatwg.org/#matching-an-image-type-pattern

// 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
Loading