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(vsix-plugin): set mime type in dev mode #250

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

CompuIves
Copy link
Collaborator

@CompuIves CompuIves commented Nov 16, 2023

In dev mode the mime type of the base64 string is hardcoded to text/javascript. This works for most files, but it won't work for e.g. file icons, which are svg. In that case, it will not render anything:
image

With this change, we use the inferred mime type for the base64. Now the main question is... Will this work for all file types?

@CompuIves CompuIves requested a review from CGNonofr November 16, 2023 16:04
@CGNonofr
Copy link
Contributor

Oh well spotted!

What is the issue though? all that mimeType stuff was added because it was important for vite to set the accept header, otherwise it was trying to bundle/compile asset files. But for base64 urls, I'm not sure what can be the issue

@CompuIves
Copy link
Collaborator Author

The main issue is that VSCode injects these base64 URLs as inline images in CSS. If the mimetype is not right, the browser refuses to render the icon.

@CGNonofr CGNonofr merged commit f2395e3 into CodinGame:main Nov 16, 2023
1 check passed
@CompuIves
Copy link
Collaborator Author

Would it be possible to cut a new release with these changes? That would enable me to do some additional work on the repo where we use the library 😄

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.

2 participants