0.0.16 • Published 2 years ago

@d-gs/vite-plugin-inject-html-tag v0.0.16

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vite-plugin-inject-html-tag

...

Usage

Install

npm i -D @d-gs/vite-plugin-inject-html-tag

or

pnpm add -D @d-gs/vite-plugin-inject-html-tag

vite.config.ts

import { defineConfig } from 'vite'
import { injectHtmlTag, HtmlTag } from '@d-gs/vite-plugin-inject-html-tag'

const htmlTag: HtmlTag = {
    head: {
        title: 'App Title',
        meta: [
            { name: 'description', content: 'Description' },
            { name: 'theme-color', content: '#000000' }
        ],
        link: [
            {
                attrs: {
                    rel: 'apple-touch-icon',
                    sizes: '180x180'
                },
                href: '/assets/apple-icon.png'
            },
            {
                attrs: {
                    rel: 'icon',
                    sizes: '192x192'
                },
                href: '/assets/icon.png'
            }
        ]
    }

}
<head>
    <title>App Title</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link href="/assets/apple-icon.png" rel="apple-touch-icon" sizes="180x180">
    <link href="/assets/icon.png" rel="icon" sizes="192x192">
    <meta name="description" content="Description">
    <meta name="theme-color" content="#000000">
</head>

head.meta.charset and head.meta.viewport are output by default. To override head.meta.charset and head.meta.viewport

const htmlTag: HtmlTag = {
    head: {
        charset: 'shift_jis',
        viewport: 'width=device-width,initial-scale=1,viewport-fit=cover',
    }

}
0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago