Socket
Book a DemoInstallSign in
Socket

rollup-plugin-svg-sprite-deterministic

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-svg-sprite-deterministic

Create deterministic external svg sprite from your bundle using Rollup

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
69
-69.6%
Maintainers
1
Weekly downloads
 
Created
Source

rollup-plugin-svg-sprite-deterministic

Build Status Codecov

Create deterministic external svg sprite file from your bundle using Rollup and optimize it using SVGO.

This is a fork of rollup-plugin-svg-sprite that creates deterministic (repeatable) builds. See #8 for motivation.

Version 2.x of this plugin has some breaking changes. See #1.

Installation

# yarn
yarn add rollup-plugin-svg-sprite-deterministic -D

# npm
npm install rollup-plugin-svg-sprite-deterministic -D

Usage

// rollup.config.js
import svgSprite from 'rollup-plugin-svg-sprite-deterministic'

export default {
  input: 'src/index.js',
  output: {
    file: 'dist/app.js',
    format: 'iife'
  },
  plugins: [
    svgSprite({
      outputFolder: 'dist/public'
    })
  ]
}

Next, import svg files in your project:

import './svg/trash.svg'
import './svg/user.svg'

Configuration

There are some useful options:

outputFolder

Type: string

Folder where generated svg sprite will be saved.

svgSprite({
  outputFolder: 'dist/public'
})

minify

Type: boolean | Default: true

Minify generated svg sprite.

svgSprite({
  outputFolder: 'dist/public',
  minify: false
})

License

MIT

Keywords

rollup

FAQs

Package last updated on 31 Jan 2022

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