Socket
Book a DemoInstallSign in
Socket

rollup-plugin-rawsvg

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-rawsvg

Import SVG images

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
51
628.57%
Maintainers
1
Weekly downloads
 
Created
Source

rollup-plugin-rawsvg

Import SVG raw files

Installation

yarn install rollup-plugin-raw-svg --dev

Usage

// rollup.config.js
import rawsvg from 'rollup-plugin-rawsvg';

export default {
  entry: 'src/input.js',
  dest: 'dist/output.js',
  plugins: [
    rawsvg()
  ]
};

You can use svgs in your bundle thusly:

import iconMenu from './icon/menu.svg'
document.body.appendChild( iconMenu )

SVGs are not encoded using base64, it will only import raw files as text

Sources

This plugin was built (based on the rollup-plugin-svg) but remove base64 encoding mecanism

rollup-plugin-svg

License

MIT

Keywords

rollup

FAQs

Package last updated on 06 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts