4.0.0 • Published 1 year ago

svgo-loader v4.0.0

Weekly downloads
179,850
License
MIT
Repository
github
Last release
1 year ago

svgo loader for webpack

Install

$ npm install svgo-loader --save-dev

... or with Yarn

$ yarn add svgo-loader -D

Usage

Documentation: Using loaders

module.exports = {
  ...,
  module: {
    rules: [
      {
        test: /\.svg$/,
        type: 'asset',
        loader: 'svgo-loader'
      }
    ]
  }
}

By default svgo-loader uses config from svgo.config.js similar to svgo cli. See how to configure svgo.

Specify configFile option to load custom config module:

module.exports = {
  ...,
  module: {
    rules: [
      {
        test: /\.svg$/,
        type: 'asset',
        loader: 'svgo-loader',
        options: {
          configFile: './scripts/svgo.config.js'
        }
      }
    ]
  }
}

or to disable loading config:

module.exports = {
  ...,
  module: {
    rules: [
      {
        test: /\.svg$/,
        type: 'asset',
        loader: 'svgo-loader',
        options: {
          configFile: false
        }
      }
    ]
  }
}

You can also specify options which override loaded from config

module.exports = {
  ...,
  module: {
    rules: [
      {
        test: /\.svg$/,
        type: 'asset',
        loader: 'svgo-loader',
        options: {
          multipass: true,
          js2svg: {
            indent: 2,
            pretty: true,
          }
        }
      }
    ]
  }
}

License and Copyright

This software is released under the terms of the MIT license.

@plone/volto@s-isabella/scripts-frontend@quantumblack/carbon-charts@mygooder/react-scriptstrading-vue-101@codewitchbella/scripts-frontend@ywjt/spa-m-builder@bybit/marvel-cli@eaze/eaze-web-scripts@triply/ldwizard-core@knapsack/toby@knapsack/app-uiwzx-resource-manager@everything-registry/sub-chunk-2859aigobao-onlineadvanced-react-scripts@zumper/react-scriptsadmanaviate@anansi/webpack-config@amilabs/pink-unicorn@app-cli/servicebeauty-webpack-v1autofe-scripts@aktiv/cliblazar-core@consta/widgets-configs@composition/composer@computerrock/react-scripts@computerrock/storybook-preset-react-app@computerrock/toolchain-react-app@ctsx/webpack@dennisdigital/polaris-components-styleguidebsl-build@betarost/cem@betarost/cemserver@blunck/webpack-scripts@bolster/boulder-webpack-config@blueking/bkmonitor-cli@blueking/bk-monitor-cli@bolt/build-tools@baiyun/yun-tools@bolt/uikit-workshopccs-template-uiomg-rc-clipoi-preset-svg-spritepatomation-react-componentsreact-scripts-bsdreact-scripts-wetimereact-starter-projectpink-unicornry-webryoko-uisa-template-2sea-ai-ui-componentsea-chartseastatisticseatable-ai-ui-componentseatable-statisticseek-style-guide-webpackxix-cliumi-plugin-svgotip-message-pluginvussrwebpack-config-aswebpack-abstractwolf-builderym-svg-spritezen-react-scriptszjp-filemanager2wub-preset-svgosuper-design-iconsstanzarizerocktime-webpackrocket-starterscistor-hj-uiscoobierjankoskusku-for-testingreact-static-plugin-svg@cirrusct/mr-build-webapp-webpackcodelane-react-scriptsclientkit@ideasonpurpose/build-tools-wordpress@ifreeworld/webpack-configcrazy-taxicultureamp-style-guide@dpc-sdp/ripple-nuxt-uicraco-plugin-svg-spriteaurornz-react-scripts@appsemble/webpack-config@epay-sparta/cli-service@eyes22798/svg-iconartsofte-spriteloaderartsofte-spriteloader2@4tw/vue-cli-plugin-svg-icon@infinitebrahmanuniverse/nolb-svgoderiv-p2pdecap-cms
4.0.0

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

2 years ago

3.0.0

3 years ago

2.2.2

3 years ago

2.2.1

5 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

9 years ago

1.0.0

9 years ago