Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svg-scaler-loader

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

svg-scaler-loader

Webpack svg scale loader

  • 0.0.1
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

SVG Scaler Loader

Scale your svg files

Install

Install

yarn add style-loader --dev

or using npm

npm install style-loader --save-dev

Usage

It's recommended to combine svg-scaler-loader with the @svgr/webpack

component.js

import Icon from './icon.svg'

webpack.config.js

{
  module: {
    rules: [
      {
        test: /\.svg$/,
        use: [
          { loader: '@svgr/webpack' },
          {
            loader: 'svg-scaler-loader',
            options: {
              width: 24,
            }
          }
        ]
      }
    ]
  }
}

Options

svgo

type:boolean, default is false, if you want optimize with svgo, please set it true;

width

type:number, will make the svg scale to the size by the number, will fix to square, unity all svg files to same size.

scale

type:number, just normal scale, but if have the width or the height option, the scale will not work.

Keywords

FAQs

Package last updated on 12 Jul 2018

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc