diff --git a/packages/playground/assets/__tests__/assets.spec.ts b/packages/playground/assets/__tests__/assets.spec.ts index 8781fec785f3f2..8efbf1fcc2f082 100644 --- a/packages/playground/assets/__tests__/assets.spec.ts +++ b/packages/playground/assets/__tests__/assets.spec.ts @@ -121,7 +121,7 @@ describe('css url() references', () => { const match = isBuild ? `data:image/png;base64` : `/foo/nested/icon.png` expect(await getBg('.css-url-base64-inline')).toMatch(match) expect(await getBg('.css-url-quotes-base64-inline')).toMatch(match) - const icoMatch = isBuild ? `data:image;base64` : `favicon.ico` + const icoMatch = isBuild ? `data:image/x-icon;base64` : `favicon.ico` const el = await page.$(`link.ico`) const herf = await el.getAttribute('href') expect(herf).toMatch(icoMatch) diff --git a/packages/vite/src/node/plugins/asset.ts b/packages/vite/src/node/plugins/asset.ts index 0b859183f6f8f3..3c7681ad6f0bb8 100644 --- a/packages/vite/src/node/plugins/asset.ts +++ b/packages/vite/src/node/plugins/asset.ts @@ -36,7 +36,7 @@ export function assetPlugin(config: ResolvedConfig): Plugin { // add own dictionary entry by directly assigning mrmine // https://github.com/lukeed/mrmime/issues/3 - mrmime.mimes['ico'] = 'image' + mrmime.mimes['ico'] = 'image/x-icon' return { name: 'vite:asset',