Socket
Socket
Sign inDemoInstall

broccoli-svg-optimizer

Package Overview
Dependencies
170
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    broccoli-svg-optimizer

Broccoli plugin for optimizing SVG files with SVGO


Version published
Weekly downloads
52K
decreased by-4.2%
Maintainers
2
Install size
14.1 MB
Created
Weekly downloads
 

Readme

Source

broccoli-svg-optimizer

Build Status Build status

Broccoli plugin for optimizing SVG files by SVGO with a persistent cache for fast restarts.

Installation

npm install --save-dev broccoli-svg-optimizer

Usage

var SVGOptimizer = require('broccoli-svg-optimizer');
var outputNode = new SVGOptimizer(inputNode, {
  persist: false,
  svgoConfig: {
    plugins: [{ removeTitle: true }],
  },
});

Options

svgoConfig

Type: Object
Default: null

Enable\disable\configure SVGO plugins to customize SVG optimization. Most of the plugins are enabled by default. Check out SVGO repository for available options.

Example:

svgoConfig: {
  plugins: [
    { removeUselessStrokeAndFill: false },
    { removeAttrs: { attrs: '(fill|fill-rule)' } },
    { removeTitle: true },
    { removeDesc: { removeAny: true } },
  ];
}

svgoModule

Type: reference to a custom svgo module
Default: svgo module defined in broccoli-svg-optimizer dependencies

Sets custom svgo module.

Example:

const SVGOptimizer = require('broccoli-svg-optimizer');

let outputNode = new SVGOptimizer(inputNode, {
  svgoModule: require('svgo'),
});

persist

Type: Boolean
Default: true

Enable\disable a persistent cache to improve build performance across restarts. Check out broccoli-persistent-filter for more details.

Running Tests

npm install
npm test

License

This project is distributed under the MIT license.


GitHub @voltidev  ·  Twitter @voltidev

Keywords

FAQs

Last updated on 06 Oct 2022

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc