24 lines
555 B
TypeScript
24 lines
555 B
TypeScript
|
import { createHtmlPlugin } from 'vite-plugin-html';
|
||
|
|
||
|
export const configHtml = (env: ImportMetaEnv, isBuild: boolean) => {
|
||
|
return createHtmlPlugin({
|
||
|
minify: isBuild,
|
||
|
inject: {
|
||
|
data: {
|
||
|
HTML_TITLE: `${env.VITE_APP_TITLE[1]}${env.VITE_APP_TITLE_SUFFIX[0]}`,
|
||
|
},
|
||
|
// 嵌入配置文件
|
||
|
tags: [
|
||
|
// {
|
||
|
// tag: 'link',
|
||
|
// attrs: {
|
||
|
// rel: 'stylesheet',
|
||
|
// href: 'http://example.css',
|
||
|
// },
|
||
|
// injectTo: 'head',
|
||
|
// },
|
||
|
],
|
||
|
},
|
||
|
});
|
||
|
};
|