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-2859omg-rc-climmintel-custom-react-scriptsmimo-websitemeyer-react-webpack-configpoi-preset-svg-spritepink-unicornmoqomorphdeckpatomation-react-componentsgraphcool-graphiqlgraphql-playground-tmpguidoez-ui-1gatsby-plugin-svgr-svgofineway-react-scriptsfreed-multifsastyleslaravel-mix-svg-spritelaravel-mix-svg-vuelaravel-mix-svg-vue-ghlaravel-mix-svg-vue-zenolaboreriitcpluginkitlight-react-scriptsm-italent-web-platformjk-build-suitereact-static-plugin-svgreact-starter-project@baiyun/yun-tools@blueking/bk-monitor-cli@blueking/bkmonitor-cli@blunck/webpack-scriptsreact-scripts-wetimereact-scripts-bsd@bolt/uikit-workshoprocket-starterrocktime-webpack@composition/composer@computerrock/react-scripts@computerrock/storybook-preset-react-app@computerrock/toolchain-react-app@consta/widgets-configsrjanko@cirrusct/mr-build-webapp-webpack@dpc-sdp/ripple-nuxt-ui@dennisdigital/polaris-components-styleguidescistor-hj-uiscoobieblazar-core@patricia_engineering/patricia-ui-componentstip-message-plugin@pixolith/webpack-sw6-config@pixolith/webpack-typo3-configsa-template-2ry-websea-ai-ui-componentsea-chartseek-style-guide-webpack@ctsx/webpackclientkitskusku-for-testing@eyes22798/svg-icon@ideasonpurpose/build-tools-wordpress@lighting-beetle/light-react-scripts@lighting-beetle/lighter-react-scripts@nerdgeschoss/configderiv-p2p@netwerkdigitaalerfgoed/ldwizard@neverbland/react-scripts@liutsing/webpack-config@mucha48/tydic-component-set@lcooper/app-scriptscultureamp-style-guide@moxy/next-common-files@mostlyserious/brightpack@ifreeworld/webpack-configcodelane-react-scripts@infinitebrahmanuniverse/nolb-svgo@firestqr/storyblocks@dvhb/webpack@dvhb/cli@epay-sparta/cli-serviceseastatisticseatable-statisticseatable-ai-ui-component
4.0.0

1 year ago

3.0.3

1 year ago

3.0.2

2 years 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

8 years ago

1.1.1

8 years ago

1.1.0

9 years ago

1.0.0

9 years ago