MCPcopy
hub / github.com/vitejs/vite / registerCustomMime

Function registerCustomMime

packages/vite/src/node/plugins/asset.ts:63–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61
62// add own dictionary entry by directly assigning mrmime
63export function registerCustomMime(): void {
64 // https://github.com/lukeed/mrmime/issues/3
65 // instead of `image/vnd.microsoft.icon` which is registered on IANA Media Types DB
66 // image/x-icon should be used instead for better compatibility (https://github.com/h5bp/html5-boilerplate/issues/219)
67 mrmime.mimes.ico = 'image/x-icon'
68 // https://mimesniff.spec.whatwg.org/#matching-an-image-type-pattern
69 mrmime.mimes.cur = 'image/x-icon'
70 // https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers#flac
71 mrmime.mimes.flac = 'audio/flac'
72 // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
73 mrmime.mimes.eot = 'application/vnd.ms-fontobject'
74}
75
76export function renderAssetUrlInJS(
77 pluginContext: PluginContext,

Callers 1

assetPluginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected