4.0.0 • Published 2 years ago

svgo-loader v4.0.0

Weekly downloads
179,850
License
MIT
Repository
github
Last release
2 years 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.

@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-2859wolf-buildervussrxix-cliwub-preset-svgosa-template-2ryoko-uiscistor-hj-uirocktime-webpackrocket-startersuper-design-iconsstanzarizeseastatisticseatable-ai-ui-componentseatable-statisticsea-chartsea-ai-ui-componentseek-style-guide-webpackmimo-websitemeyer-react-webpack-configmmintel-custom-react-scriptslight-react-scriptslaravel-mix-svg-spritelaravel-mix-svg-vuelaravel-mix-svg-vue-ghlaravel-mix-svg-vue-zenographql-playground-tmpjk-build-suitemorphdeckguidoiitcpluginkitgraphcool-graphiqllaborermoqom-italent-web-platformpink-unicornomg-rc-clipoi-preset-svg-spritepatomation-react-componentsreact-scripts-bsdreact-starter-projectreact-scripts-wetimereact-static-plugin-svgrjankory-webskusku-for-testingumi-plugin-svgotip-message-plugin@amilabs/pink-unicorn@app-cli/service@appsemble/webpack-config@anansi/webpack-config@aktiv/cli@baiyun/yun-tools@betarost/cem@betarost/cemserver@blueking/bk-monitor-cli@blueking/bkmonitor-cli@blunck/webpack-scripts@cirrusct/mr-build-webapp-webpack@4tw/vue-cli-plugin-svg-icon@bolster/boulder-webpack-config@bolt/build-tools@dennisdigital/polaris-components-styleguide@consta/widgets-configsym-svg-spritezen-react-scriptswebpack-abstractwebpack-config-aszjp-filemanager2@dvhb/webpack@dvhb/cli@hashicorp/platform-nextjs-plugin@ideasonpurpose/build-tools-wordpress@firestqr/storyblocks@infinitebrahmanuniverse/nolb-svgo@liutsing/webpack-config@lcooper/app-scripts@lexiang/mystique-cli-service@inyur/nuxt-svg@lighting-beetle/light-react-scripts@lighting-beetle/lighter-react-scripts@mad-js-dev/custom-uikit-workshop-mad-js-dev@mango-scripts/react-scripts@micro-app/plugin-vuepress@moxy/next-common-files@mucha48/tydic-component-set
4.0.0

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

4 years ago

2.2.2

4 years ago

2.2.1

5 years ago

2.2.0

6 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

10 years ago

1.0.0

10 years ago