Registry / devops / font-config-webpack-plugin

font-config-webpack-plugin

JSON →
library2.0.3jsnpmunverified

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-plugin
INSTALL
IMPORT
SIG · FONT-CONFIG-WEBPAC
F
font-config-webpack-plugin
devopsjavascriptv2.0.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FontConfigWebpackPlugin
const FontConfigWebpackPlugin = require('font-config-webpack-plugin');
import FontConfigWebpackPlugin from 'font-config-webpack-plugin';
CommonJS only; ESM import is not supported directly. Use require() or dynamic import().
FontConfigWebpackPlugin
new FontConfigWebpackPlugin()
new fontConfigWebpackPlugin()
Constructor name is PascalCase; case-sensitive.
Plugin options
new FontConfigWebpackPlugin({ name: 'fonts/[name].[ext]' })
new FontConfigWebpackPlugin({ filename: 'fonts/[name].[ext]' })
Use 'name' option, not 'filename'. The option overrides the default file name pattern.

Minimal webpack configuration using font-config-webpack-plugin in production mode with default settings.

const FontConfigWebpackPlugin = require('font-config-webpack-plugin'); module.exports = { mode: 'production', plugins: [new FontConfigWebpackPlugin()], };
Debug
Known issues
breakingMajor version 2.0.0+ removed support for webpack <4.
fix
Upgrade webpack to >=4.36.0. If staying on webpack 3, use version 1.x.
affects: <2.0.0
deprecatedThe 'name' option uses file-loader placeholders; file-loader is deprecated in webpack 5 in favor of asset modules.
fix
For webpack 5, consider using asset modules directly or wait for plugin update.
affects: >=2.0.0
gotchaPlugin expects webpack mode to be set; otherwise defaults may not apply correctly.
fix
Set mode: 'development' or 'production' in webpack config.
affects: >=2.0.0
gotchaOnly processes font file types; other assets require separate plugins from the suite.
fix
Use sibling plugins like image-config-webpack-plugin for images.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Cannot find module 'font-config-webpack-plugin'
Package not installed or not in node_modules.
fix
Run 'npm install --save-dev font-config-webpack-plugin'.
TypeError: FontConfigWebpackPlugin is not a constructor
Incorrect import (e.g., named import instead of default) or typo in class name.
fix
Use 'const FontConfigWebpackPlugin = require('font-config-webpack-plugin')' and then 'new FontConfigWebpackPlugin()'.
ValidationError: Invalid options object. Font Config Plugin has been initialized using an options object that does not match the API schema.
Passing an option not recognized (e.g., 'filename' instead of 'name').
fix
Use correct option key 'name' for customizing file naming.
Upgrade
Version history
2.0.3latest on npm
Audit
Dependencies
webpackrequiredPeer dependency required to apply plugin configuration.
Agent activity
2 hits · last 30 days
node
2
Resources
font-config-webpack-plugin — npm install font-config-webpack-plugin · libregistry