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
While many of the above issues have "closed", the issue hasn't actually found a solution.
The only solution that has come close is creating a .htmlnanorc file in the project root with the following content:
{
"minifySvg": false
}
Yet this falls short, because the resulting attribute is renamed from viewBox to viewbox which renders it useless since browsers only understand viewBox.
This has affected me in such that I am unable to load fontawesome icons in my Parcel-built project.
Here is a screenshot of the production build, with the dev tools open inspecting the ghot svg - you can see in the devtools below that the svg is in the DOM, but not rendered on the page because the attribute is mis-named viewbox:
The text was updated successfully, but these errors were encountered:
brianzelip
changed the title
How to stop Parcel from removing and lowercasing svg viewBox attribute?
How to stop Parcel from removing and lowercasing svg viewBox attribute in production?
Oct 16, 2018
β Question
How to stop Parcel from removing and lowercasing svg
viewBox
attribute on production build?π¦ Context
This issue relates to PostHTML, HTMLnano, SVGO, and has been reported at least via:
viewBox
attribute getting stripped in HTMLΒ #1523While many of the above issues have "closed", the issue hasn't actually found a solution.
The only solution that has come close is creating a
.htmlnanorc
file in the project root with the following content:Yet this falls short, because the resulting attribute is renamed from
viewBox
toviewbox
which renders it useless since browsers only understandviewBox
.This has affected me in such that I am unable to load fontawesome icons in my Parcel-built project.
Here is a screenshot of the production build, with the dev tools open inspecting the ghot svg - you can see in the devtools below that the svg is in the DOM, but not rendered on the page because the attribute is mis-named
viewbox
:π» Code Sample
viewBox
attrπ Your Environment
The text was updated successfully, but these errors were encountered: