Skip to content

stryaponoff/vite-plugin-preload-webfont

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-plugin-preload-webfont

Usage example:

// vite.config.ts
import { resolve } from 'path';
import { defineConfig } from 'vite';
import { viteSvgToWebfont } from 'vite-svg-2-webfont';
import { vitePluginPreloadWebfont } from 'vite-plugin-preload-webfont'

const webfontFolder = resolve('./src/webfont');

export default defineConfig({
    plugins: [
        viteSvgToWebfont({
            context: webfontFolder,
            htmlDest: resolve(webfontFolder, 'icons.ts'),
            htmlTemplate: resolve(webfontFolder, 'icons.ts.hbs'),
            fontName: 'exampleIcon',
            baseSelector: '.exIcon',
            generateFiles: 'html',
        }),
        vitePluginPreloadWebfont({ preloadFormats: ['woff2'] }),
    ],
});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published