You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a base64 encoded font in a CSS file. When it is parsed through the built-in minifier used by Vite (during the build process), it fails compilation because of an error introduced by the fix for issue #426.
This specific font I'm using, when converted to base64, includes // as part of its string. The code below interprets this as a comment and completely removes the rest of the base64 string, thereby rendering the font unusable.
When the file is minified, however, the entire rest of the file is erased as well, because it's interpreted as part of the comment (minifier places everything on same line).
I did not try it with Vite 1.0. Unfortunately I didn't use Vite to compile my css at the time, I decided to do that when I upgraded to 2.0. When I have some time, I can mock up a test and try it out.
Describe the bug
I have a base64 encoded font in a CSS file. When it is parsed through the built-in minifier used by Vite (during the build process), it fails compilation because of an error introduced by the fix for issue #426.
This specific font I'm using, when converted to base64, includes
//
as part of its string. The code below interprets this as a comment and completely removes the rest of the base64 string, thereby rendering the font unusable.When the file is minified, however, the entire rest of the file is erased as well, because it's interpreted as part of the comment (minifier places everything on same line).
vite/packages/vite/src/node/plugins/css.ts
Lines 118 to 120 in 60fca98
Extra Info
I had originally thought this would be fixed by #936 but as it turns out, this was an entirely separate issue.
Reproduction
//
in any CSS property that accepts a string ex:font-family: '//';
System Info
vite
version: 2.0 beta 4@vue/compiler-sfc
version: 3.0.4The error message when minifying fails
This doesn't entirely reflect the specific error going on, as it's not directly related to the minifier, but I'm including this for completeness sake.
The text was updated successfully, but these errors were encountered: