A Rollup plugin that subsets Material Design Icons (MDI) font files to include only the icons you specify. Current version is 1.2.7 (stable, maintained). It leverages fontmin to generate reduced TTF, EOT, WOFF, and WOFF2 files and patches the CSS accordingly. Unlike generic font subsetters, it is tightly integrated with MDI's naming conventions and Rollup's build pipeline. Works with @mdi/font v1–v7 and Rollup v1–v4.
npm install rollup-plugin-mdi-fontminNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows typical Rollup configuration using the plugin with required 'names' option and custom output directory.
Provide a non-empty array like ['home', 'account'].
Use `mkdir -p public/fonts/mdi` or ensure parent directories exist before build.
Clean the output directory before each build (e.g., using rollup-plugin-clean or rimraf).
Install fontmin@2: `npm install fontmin --save-dev` or `npm install fontmin@2 --save-dev`.
Use ESM imports and Node 18+. For older Node, pin to v1.1.x.
In package.json add "type": "module" or use .mjs extension for config file, or pin to v1.1.x: `npm install rollup-plugin-mdi-fontmin@1.1.0`
Pass an array of icon names: `mdiFontmin({ names: ['home', 'account'] })`Verify icon names exist in the MDI set (use lowercase, no 'mdi-' prefix). E.g., 'home' not 'Home' or 'mdi-home'.