1.1.0 • Published 6 years ago

rollup-inline-svg v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

rollup-inline-svg

Inline SVG files

Installation

npm install --save-dev rollup-inline-svg

Usage

// rollup.config.js
import inlineSVG from 'rollup-inline-svg';

export default {
  input: './input.js',
  output: {
    file: './output.js',
    format: 'cjs',
  },
  plugins: [
    inlineSVG({
      // process SVG to String or DOM Node. Default: false
      stringify: false
    }),
  ],
};

You can now use SVG in your bundle like so:

import compass from './compass.svg';
import star from './star.svg';

document.body.appendChild(compass());

// with attributes override
document.body.appendChild(star({
  fill: '#e91e63',
  class: 'icon'
}));

License

MIT

1.1.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago