question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion: Leave SVGO out of this package

See original GitHub issue

You can easily add SVGO to the pipeline on Webpack, so leave it out of your package to reduce complexity.

Webpack 2 example:

{
  test: /\.svg$/,
  loaders: [
    'babel-loader',
    'react-svg-loader',
    {
      loader: 'svgo-loader',
      options: {
        floatPrecision: 2
        plugins: [{removeTitle: false}],
      }
    },
  ]
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
plumacommented, Mar 2, 2017

Just an FYI: I’ve had react-svg-loader blow up because an SVG contained CSS (which contains curly braces which JSX treats specially) so this approach is pretty error prone.

1reaction
boopathicommented, Feb 6, 2017

1, 2(remove comments and doctype) and also fix up invalid XML and 3 - is exactly what SVGO already does. Since we already use SVGO, it’d be good and easy just to expose the API.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Three Ways of Decreasing SVG File Size with SVGO - SitePoint
In this article I suggest three ways in which SVGO lets you optimize SVG graphics to make them suitable for web use.
Read more >
Optimizing SVG for the Web - Web Design Weekly
We'll take a look at a command line tool that can help us clean that up a bit called SVGO. It's a Node...
Read more >
npm upgrade and npm audit fix: problems with vulnerabilities ...
As the new version 6.3.0 doesn't have the proper @svgo and @svgr we won't be able to access those modules. So, my suggestion...
Read more >
Base64 SVG erros on :production - sage - Roots Discourse
Everything compiles when running yarn build , but after running yarn build:production , I get svgo errors. This only happens when including only ......
Read more >
svgo - npm
svgo. TypeScript icon, indicating that this package has built-in type declarations. 3.0.2 • Public • Published a month ago.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found