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

fix: add missed JPEG file extensions to KNOWN_ASSET_TYPES #8565

Merged
merged 1 commit into from
Jun 13, 2022

Conversation

cawa-93
Copy link
Contributor

@cawa-93 cawa-93 commented Jun 13, 2022

Description

Add more JPEG file extensions to KNOWN_ASSET_TYPES. I get extensions from MDN https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@sapphi-red
Copy link
Member

mrmime(ext) returns undefined for these extensions.
So if these files were inlined, I suppose it will become data:undefined;base64,content.

url = `data:${mrmime.lookup(file)};base64,${content.toString('base64')}`

> require('mrmime').lookup('.jfif')
undefined
> require('mrmime').lookup('.pjpeg')
undefined
> require('mrmime').lookup('.pjp')
undefined

It seems there are some other extensions which have the same problem. (.ico is ok)

> require('mrmime').lookup('.ico')
undefined
> require('mrmime').lookup('.flac')
undefined
> require('mrmime').lookup('.aac')
undefined
> require('mrmime').lookup('.eot')
undefined

Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

As there are some extensions which is lacking mime data, I will create a PR after this PR was merged.

@patak-dev patak-dev changed the title fix(vite): add missed JPEG file extensions to KNOWN_ASSET_TYPES fix: add missed JPEG file extensions to KNOWN_ASSET_TYPES Jun 13, 2022
@patak-dev patak-dev merged commit 2dfc015 into vitejs:main Jun 13, 2022
@cawa-93 cawa-93 deleted the jpeg-asset-types branch June 13, 2022 12:41
@sapphi-red sapphi-red mentioned this pull request Jun 13, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants