vite-plugin-gfont
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

vite-plugin-gfont

This plugin can automatically inject google font tags into your HTML.

Usage

Step 1: Install the package.

npm install vite-plugin-gfont -D

Step 2: Import it to your vite configuration.

import gfont from 'vite-plugin-gfont';

export default defineConfig({
  plugins: [gfont({
    proxy: '', // use proxy for google font
    fonts: [
      {
        family: 'Roboto',
        styles: [
          400,
          {
            weight: 500,
            italic: true,
          },
        ]; // weight or {weight, italic}, optional.
      },
    ],
    display: 'swap', // https://developer.mozilla.org/en-US/docs/Web/API/FontFace/display
  })],
});

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i vite-plugin-gfont

Weekly Downloads

2

Version

0.2.0

License

MIT

Unpacked Size

25.4 kB

Total Files

11

Last publish

Collaborators

  • backrunner