Webpack loader for creating SVG sprites, enabling inline SVG usage via <use> tags. Current stable version 6.0.11, with a release cadence of roughly 2-3 major versions per year. Key differentiators: automatic runtime injection, isomorphic support for node/browser, customizable runtime generators, and external sprite file extraction for CSS/HTML imports. Supports webpack 5 (v6+), webpack 4 (v5), and earlier versions. Maintained by JetBrains.
npm install svg-sprite-loaderVerified import paths — ran on the pinned version, not inferred.
Configures webpack to load SVG files as sprite symbols, using svgo for optimization. Imports return symbol objects usable with <use>.
Update webpack to version 5 or later. If using webpack 4, continue using v5.2.1.
Update custom runtime generators to use the new context meaning.
Use runtimeOptions instead.
Explicitly set esModule: true if using ESM imports, false for CommonJS.
Use object.url for external sprite file references.
Run 'npm install svg-sprite-loader --save-dev' or 'yarn add svg-sprite-loader -D'.
Ensure options is an object; if using symbolId function, return a string.
Upgrade to v6.0.0 or later, or adjust multi-config setup.