SVGER-CLI includes a built-in optimizer with documented local benchmark evidence up to 57.77% file size reduction, without requiring a separate SVGO installation.
Integrated processing, lighter SVG output, and zero extra optimizer configuration for the common path.
Compare the old way versus the new approach and see the dramatic difference.
Adds ~500KB to your project
2x slower than built-in
Requires plugin setup
Compatibility issues
npm install svgo required
Bundled with SVGER-CLI
Benchmark scope documented
No configuration needed
Built into SVGER-CLI
Up to 57.77% reduction
Choose the right balance between file size, processing speed, and safety for your use case.
Best for development and most production use cases
import { SVGProcessor, OptLevel } from 'svger-cli';
const processor = SVGProcessor.getInstance();
processor.setOptimizationLevel(OptLevel.BALANCED);
const optimized = await processor.cleanSVGContent(svgString);
// Result: 43.33% reduction (safe + fast)
For CI/CD builds and production bundles
processor.setOptimizationLevel(OptLevel.AGGRESSIVE);
const optimized = await processor.cleanSVGContent(svgString);
// Result: 48.91% reduction (balanced performance)
Maximum compression for production assets
processor.setOptimizationLevel(OptLevel.MAXIMUM);
const optimized = await processor.cleanSVGContent(svgString);
// Result depends on SVG structure; project samples have recorded reductions up to 57.77%.
The optimizer uses a sophisticated 5-phase pipeline to achieve maximum compression:
Foundation cleaning
Removes unnecessary elements, comments, metadata, and XML declarations that add no visual value.
BALANCED level and above
AGGRESSIVE level and above
MAXIMUM level only
Real-world results from production SVG optimization across different file types.
Use the current v4 CLI commands: build for component generation and optimize for direct SVG optimization.
Build a directory of SVGs into components and select an explicit optimization level.
# Generate components with explicit optimization
npx svger build ./icons ./components --optimize balanced
# Supported levels: none, basic, balanced, aggressive, maximum
Optimize one SVG file or a directory and write the optimized output separately.
# Optimize directly with maximum-level settings
npx svger optimize ./icons ./optimized-icons --level maximum
# Validate XML before writing directory output
npx svger optimize ./icons ./optimized-icons --level balanced --validate
Use none when a migration or characterization test needs byte-level comparison.
# Disable optimization during component generation
npx svger build ./icons ./components --optimize none
See how SVGER-CLI's built-in optimizer is positioned against a separate SVGO workflow.