Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gaothing/vite-plugin-html-info-inject
vite插件,可以插件的形式配置title、keyword、css、js注入
https://github.com/gaothing/vite-plugin-html-info-inject
Last synced: 16 days ago
JSON representation
vite插件,可以插件的形式配置title、keyword、css、js注入
- Host: GitHub
- URL: https://github.com/gaothing/vite-plugin-html-info-inject
- Owner: gaothing
- Created: 2022-10-22T04:24:18.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-26T04:28:00.000Z (about 2 years ago)
- Last Synced: 2024-11-21T14:40:45.467Z (about 2 months ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## vite-plugin-html-info-inject
---
vite 插件,可配置化的添加html的页面,title、keywords、description,注入js、css
可在开发环境开启调试工具vconsole调试台
> example
```js
import vitePluginHtmlInfoInject from 'vite-plugin-html-info-inject'
export default defineConfig({
plugins: [
// ...
vitePluginHtmlInfoInject({
title:"你好,我是title", //标题
script:[{src:"https://baidu.ccom",pre:true}], //外链js
css:[{src:"https://ss.cc"},{src:"https://ss.cc"}], //外链的css配置
keywords:'我是关键字', //meta 关键字
description:'我是描述', //meta 描述
vconsole: true //是否开启调试台 开发模式
})
]
})```
> 说明
- `pre`代表script的位置,pre为`true`时,将插入到head中,默认html标签后
- script和css为单个的话,可以通过字符串的形式直接配置
- vconsole 调试控制台,`true`时会在开发环境显示调试台