desvg icon indicating copy to clipboard operation
desvg copied to clipboard

Install/Usage steps not complete

Open dave-irvine opened this issue 6 years ago • 2 comments

Hi! Thanks for the library, I've found it really useful, but I don't think your install instructions are quite correct. You say that to use with webpack, all your need is:

npm install desvg-loader svg-loader --save-dev

and then configure webpack, with

npm install @kossnocorp/desvg --save

only being required to "use the low-level API, or to manage the core library version". However, the desvg-loader package requires this package: https://github.com/kossnocorp/desvg-loader/blob/master/react.js#L4

so without this package installed as well, you get an error.

Also the proposed webpack config won't work with newer versions of webpack:

use: [
  'desvg/react',
  'svg'
],

you need the "loader" suffix on both of those loader packages.

dave-irvine avatar Nov 28 '17 17:11 dave-irvine

In my case what worked looked like this 👇

{
  test: /\.svg$/, 
  use: [
    { loader: "desvg-loader/react" },
    { loader: "svg-loader" }
  ]
}

j33n avatar May 03 '18 14:05 j33n

@j33n & @dave-irvine Thank you both, this saved me from giving up on this lib

nijk avatar Aug 17 '18 14:08 nijk