Skip to content
PluginStats

svg-chunk-webpack-plugin weekly downloads statistics

By yoriiis · npm · Webpack plugins

Generate SVG sprites according to entrypoint dependencies. Each page only imports its own svgs, wrapped as a sprite and optimized by svgo

View on npm Fresh · Dec 6, 2026

svg-chunk-webpack-plugin has 1,963 recorded weekly downloads on npm, a decrease of 11.3% over the past 30 days, ranking #1886 of 3,247 tracked listings.

Weekly downloads
1,963
Official API · Dec 5, 2026
7-day growth
-23.6%
-606 weekly downloads
30-day growth
-11.3%
-250 weekly downloads
90-day growth
+29.2%
+444 weekly downloads
Rank
#1886
▼ 183 in 7 days

About svg-chunk-webpack-plugin

SvgChunkWebpackPlugin

GitHub Workflow Status (branch) Coverage Status Npm downloads

The svg-chunk-webpack-plugin creates optimized SVG sprites, according to Webpack's entrypoints. Each sprite contains only the SVG dependencies listed on its entrypoints to improved code splitting, even on SVG files.

The plugin includes the popular SVGO package to generates clean and optimized SVG sprites.

Code splitting is the key to deliver files without any content that is unused by the pages. It already exists for CSS, Javascript and now for SVG files with this plugin.

When to use this plugin

On multiple page application, each pages must includes only its necessary dependencies. In other words, it must include only the SVG files imported by its entrypoint and all its dependencies.

With reusable components, SVGs are often duplicated on all the project. Now, you can create a global SVG library and every Javascript files can easily import any SVG from this library. Entrypoint dependencies are automatically updated, thanks to the Webpack compilation.

When you work with SVGs exported by design softwares, like Sketch or Illustrator, their source code is never optimized and often contains comments, CSS classes which can create conflicts between them. The plugin automatically cleans all SVGs before creating the sprite.

Zero config

The plugin works without configuration with already the optimized settings. For advanced usage, see the section using configuration.

Installation

The plugin is available as a package with the name of svg-chunk-webpack-plugin on npm and Github.

npm install svg-chunk-webpack-plugin --save-dev
yarn add svg-chunk-webpack-plugin --dev
<!-- markdownlint-disable MD028 -->

[!WARNING] Plugin svg-chunk-webpack-plugin@5 is ESM only.\n

[!NOTE] Minimum supported Node.js version is 16.20.0 and Webpack >=5.10.3.

[!NOTE] The plugin is compatible with html-webpack-plugin (optional dependency). Use the injectSpritesInTemplates option to automatically inject sprites into your HTML templates.

<!-- markdownlint-enable MD028 -->

Example

The project includes a minimalist example in the ./example directory. Run the npm run build:example command to execute the Webpack example and see the plugin's implementation in action.

Basic usage

The plugin will generate one SVG sprite for each entrypoints. Sprites are built in the output path directory with all the other assets. Each sprite filename is composed with its entrypoint name (in the example below, that would be home.svg).

First, let's add the loader and the plugin to the Webpack configuration.

[!WARNING] The loader and the plugin need to works together.

webpack.config.js

import SvgChunkWebpackPlugin from 'svg-chunk-webpack-plugin';

export default {
  module: {
    rules: [
      {
        test: /\.svg$/,
        use: [
          {
            loader: SvgChunkWebpackPlugin.loader
          }
        ]
      }
    ]
  },
  plugins: [new SvgChunkWebpackPlugin()]
};

[!NOTE] For more flexibility and better performance, inline SVG files are better. Fewer HTTP requests, CSS properties to change the style, no flickering during the page load.

Then, include the sprite in the wanted pages (we use Twig in the following example).

home.html.twig

{{ include 'home.svg' }}

Finally, use the SVG with the <use> tag, like the following example. Replace <svg_name> by the SVG name (without the extension).

home.html.twig

<svg>
  <use href="#<svg_name>"></use>
</svg>

Using a configuration

The loader and the plugin accepts configuration to override the default behavior.

Loader

The loader configuration allow to personalize the SVGO configuration. SVGO optimization is executed during the loader process to optimize build performance.

configFile

Type:

type configFile = string | boolean;

Default: path.resolve(opts.root, 'svgo.config.js')

Tells the loader whether to load the custom SVGO configuration. Custom configuration can be disabled with configFile: false.

webpack.config.js

export default {
  module: {
    rules: [
      {
        test: /\.svg$/,
        loader: SvgChunkWebpackPlugin.loader,
        options: {
          configFile: './path/svgo.config.js'
        }
      }
    ]
  }
};
SVGO custom configuration

SVGO have a default preset to optimize SVG files. See how to configure svgo for details.

svgo.config.js

export default {
  multipass: true,
  plugins: [
    {
      name: 'preset-default',
      params: {
        overrides: {
          inlineStyles: {
            onlyMatchedOnce: false
          },
          removeViewBox: false
        }
      }
    },
    {
      name: 'convertStyleToAttrs'
    }
  ]
};
Plugin

The plugin configuration allow to personalize sprite settings.

filename

Type:

type filename = string;

Default: '[name].svg'

Tells the plugin whether to personalize the default sprite filename. The placeholder [name] is automatically replaced by entrypoints names.

webpack.config.js…

Description from the npm listing.

  • svg
  • svg-sprite
  • svgo
  • svgstore
  • webpack
  • webpack-plugin
  • webpack-loader
  • chunk
  • optimization
  • minification
  • javascript

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

svg-chunk-webpack-plugin weekly downloads on npm, last 90 days: 1,963 weekly downloads as of Dec 5, 2026, +29.2% over 90 days.svg-chunk-webpack-pluginWeekly downloads on npm · Last 90 days1,963downloads / week+29.2% over 90 days05001K1.5K2K2.5K3K3.5KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
svg-chunk-webpack-plugin weekly downloads on npm, last 90 days: 1,963 weekly downloads as of Dec 5, 2026, +29.2% over 90 days.

7/30/90-day growth

svg-chunk-webpack-plugin weekly downloads growth on npm: -23.6% over 7 days, -11.3% over 30 days, +29.2% over 90 days.svg-chunk-webpack-pluginWeekly downloads growth on npm1,963downloads / week now7-day growth-606 weekly downloads-23.6%30-day growth-250 weekly downloads-11.3%90-day growth+444 weekly downloads+29.2%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
svg-chunk-webpack-plugin weekly downloads growth on npm: -23.6% over 7 days, -11.3% over 30 days, +29.2% over 90 days.

Ranking history

svg-chunk-webpack-plugin npm ranking history: currently #1886 (by weekly downloads).svg-chunk-webpack-pluginnpm ranking · by weekly downloads · Last 90 days#1886current rank#400#600#800#1000#1200#1400#1600#1800#2000Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
svg-chunk-webpack-plugin npm ranking history: currently #1886 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 95, #6 (overall #1,886)
All npm: every listing in weekly downloads order

Listing placement

Webpack plugins349 listings · 18 pages · page 3, #19 (overall #59)
Webpack plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (592)
Recent weekly downloads observations for svg-chunk-webpack-plugin
Date (UTC)Weekly downloadsChange vs. previous
1,963+29
1,934+98
1,836+76
1,760-53
1,813-364
2,177-232
2,409-160
2,569-175
2,744-213
2,957-130
3,087+86
3,001+468
2,533+342
2,191—

Similar npm Webpack plugins plugins

All 20 svg-chunk-webpack-plugin alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/svg-chunk-webpack-plugin. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.