@svgr/rollup
SVGR Rollup plugin.
Last updated 2 months ago by neoziro .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @svgr/rollup 
SYNC missed versions from official npm registry.

@svgr/rollup

Build Status Version MIT License

Rollup plugin for SVGR.

npm install @svgr/rollup --save-dev

In your rollup.config.js:

{
  plugins: [svgr()]
}

In your code:

import Star from './star.svg'

const App = () => (
  <div>
    <Star />
  </div>
)

Passing options

{
  plugins: [svgr({ native: true })]
}

Using with url plugin

It is possible to use it with url.

In your rollup.config.js:

{
  plugins: [url(), svgr()]
}

In your code:

import starUrl, { ReactComponent as Star } from './star.svg'

const App = () => (
  <div>
    <img src={starUrl} alt="star" />
    <Star />
  </div>
)

Use your own Babel configuration

By default, @svgr/rollup applies a babel transformation with optimized configuration. In some case you may want to apply a custom one (if you are using Preact for an example). You can turn off Babel transformation by specifying babel: false in options.

{
  plugins: [svgr({ babel: false })]
}

License

MIT

Current Tags

  • 2.0.0-alpha.26fa501a                                ...           canary (2 years ago)
  • 5.4.0                                ...           latest (2 months ago)

29 Versions

  • 5.4.0                                ...           2 months ago
  • 5.3.1                                ...           3 months ago
  • 5.3.0                                ...           3 months ago
  • 5.2.0                                ...           4 months ago
  • 5.1.0                                ...           5 months ago
  • 5.0.1                                ...           6 months ago
  • 5.0.0                                ...           6 months ago
  • 4.3.3                                ...           9 months ago
  • 4.3.2                                ...           a year ago
  • 4.3.1                                ...           a year ago
  • 4.3.0                                ...           a year ago
  • 4.2.0                                ...           a year ago
  • 4.1.0                                ...           2 years ago
  • 4.0.4                                ...           2 years ago
  • 4.0.3                                ...           2 years ago
  • 4.0.2                                ...           2 years ago
  • 4.0.1                                ...           2 years ago
  • 4.0.0                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 2.4.1                                ...           2 years ago
  • 2.4.0                                ...           2 years ago
  • 2.3.0                                ...           2 years ago
  • 2.2.1                                ...           2 years ago
  • 2.2.0                                ...           2 years ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 2.0.0-alpha.26fa501a                                ...           2 years ago
Maintainers (1)
Downloads
Today 12
This Week 1,302
This Month 767
Last Day 39
Last Week 979
Last Month 5,267
Dev Dependencies (3)

Copyright 2014 - 2017 © taobao.org |