vite-font-extractor-plugin
Version:
Vite plugin for extracting glyphes by ligatures from font and creating new minimized fonts with them
27 lines (22 loc) • 790 B
TypeScript
import { Plugin, InlineConfig } from 'vite';
import { MinifyOption } from 'fontext';
type Target = Omit<MinifyOption, 'formats'>;
interface PluginCommonConfig {
cache?: string | boolean;
apply?: Plugin['apply'];
logLevel?: InlineConfig['logLevel'];
}
interface PluginManualOption {
type: 'manual';
targets: Target[] | Target;
ignore?: string[];
}
interface PluginAutoOption {
type: 'auto';
targets?: Target[] | Target;
ignore?: string[];
}
type PluginOption = PluginCommonConfig & (PluginAutoOption | PluginManualOption);
declare function FontExtractor(pluginOption?: PluginOption): Plugin;
type FontExtractorPlugin = typeof FontExtractor;
export { FontExtractor, type FontExtractorPlugin, type PluginOption, type Target, FontExtractor as default };