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: update svgr webpack config to use svg dimensions #24747

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions superset-frontend/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,11 @@ const config = {
{
loader: '@svgr/webpack',
options: {
icon: true,
Copy link
Member

Choose a reason for hiding this comment

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

are the defaults good? do we want to be explicit as in

options: {
  // making sure that svgo isn't setting width:1em
  icon: false,
  // don't allow svgo to alter/opitmize the svg 
  svgo: false,
},

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, good idea. The default for svgo is actually true and I don't think it will break anything in this use case if changed to false, but I'll add in the default for icon with a comment.

svgo: false,
svgoConfig: {
plugins: [{ removeViewBox: false }],
},
titleProp: true,
ref: true,
// this is the default value for the icon. Using other values
// here will replace width and height in svg with 1em
icon: false,
},
},
],
Expand Down