3.0.3 • Published 5 years ago

react-svg-loader-cli v3.0.3

Weekly downloads
26,831
License
MIT
Repository
github
Last release
5 years ago

react-svg-loader-cli

Provides CLI: svg2react

CLI of react-svg-loader

Install

npm i react-svg-loader-cli --save-dev

# or with yarn

yarn add react-svg-loader-cli --dev

Install it globally,

npm i -g react-svg-loader-cli

# or with yarn

yarn global add react-svg-loader-cli

Usage (svg2react)

Use this CLI to convert svg files to react components. This is helpful when you'd want to customize your svg component by hand.

`npm bin`/svg2react file1.svg file2.svg

and the following files will be emitted

  • file1.svg.react.js
  • file2.svg.react.js

in the SAME directory as the files

CLI Options

  • --jsx: Outputs JSX code instead of compiling it to JavaScript using babel-preset-react
  • --stdout: Outputs to STDOUT
  • --svgo <config_file>: Supports SVGO Config YAML / JSON / JS
  • --svgo.plugins <...plugins>: Takes in an array of plugins that need to be enabled
  • --svgo.plugins.<plugin> <true|false>: - Enable/Disable the plugin
  • --svgo.floatPrecision $N: Set floatPrecision to N for SVGO. SVGO supports 1-8.
`npm bin`/svg2react file1.svg --jsx --stdout

LICENSE

MIT

3.0.4-alpha.3

5 years ago

3.0.4-alpha.2

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.2-alpha.2

5 years ago

3.0.2-alpha.1

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.1.1-alpha.36

5 years ago

2.1.0

7 years ago

2.0.0

7 years ago

2.0.0-alpha.4

7 years ago