1.0.4 • Published 7 years ago

svg2base64-loader v1.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

A Webpack Loader to turn SVGs into Base64

Install

npm i -D svg2base64-loader

Useage

// without webpack loader config
import FirstImage from 'svg2base64!./firstImage.svg'; // also support .svgx file
// or let FirstImage = require('svg2base64!./firstImage.svg');

// with webpack loader config
import SecondImage from './secondImage.svg';
// or let SecondImage = require('/secondImage.svg');

// use in your component
<img src={FirstImage} />
<img src={SecondImage} />

Loader output

Webpack1.x

// In your webpack config
{
  test: /\.(svg|svgx)$/,
  loader: "svg2base64"
}

Webpack2.x

// In your webpack config
{
  test: /\.(svg|svgx)$/,
  use: ["svg2base64"]
}
1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.1

7 years ago