Preset webpack plugin that configures loaders for font files (e.g., woff, woff2, ttf, eot, svg) with best practices for development and production modes. Version 2.0.3 is the latest stable release, part of the common-config-webpack-plugin suite maintained by Merkle Open. It automatically adjusts configuration based on webpack mode, supports long-term caching via content hash, and integrates with file-loader. Compared to manual webpack font configuration, it provides a zero-config setup with sensible defaults.
npm install font-config-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Minimal webpack configuration using font-config-webpack-plugin in production mode with default settings.
Upgrade webpack to >=4.36.0. If staying on webpack 3, use version 1.x.
For webpack 5, consider using asset modules directly or wait for plugin update.
Set mode: 'development' or 'production' in webpack config.
Use sibling plugins like image-config-webpack-plugin for images.
Run 'npm install --save-dev font-config-webpack-plugin'.
Use 'const FontConfigWebpackPlugin = require('font-config-webpack-plugin')' and then 'new FontConfigWebpackPlugin()'.Use correct option key 'name' for customizing file naming.