font-family usage in your CSS and injects optimized @font-face declarations.Add the fontless plugin to your Vite configuration:
Simply use fonts in your CSS as you normally would, and fontless will handle optimization:
You can customize fontless with various options:
The npm provider resolves fonts from locally installed npm packages such as @fontsource/*, @fontsource-variable/*, and cal-sans. It is enabled by default with remote: false, meaning it only reads from your local node_modules without making any network requests.
Install a font package and use it in your CSS:
The npm provider will automatically detect the installed @fontsource/inter package and resolve the font from node_modules.
You can also specify npm-specific options per font family:
Fontless works by:
font-family declarations.@font-face declarations with proper metrics.corepack enablepnpm installpnpm devMade with ❤️
Published under MIT License.