mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 01:54:48 +00:00
feat(@vant/cli): add site.htmlMeta option
This commit is contained in:
@@ -60,6 +60,18 @@ function getTitle(config: { title: string; description?: string }) {
|
||||
return title;
|
||||
}
|
||||
|
||||
function getHTMLMeta(vantConfig: any) {
|
||||
const meta = get(vantConfig, 'site.htmlMeta');
|
||||
|
||||
if (meta) {
|
||||
return Object.keys(meta)
|
||||
.map((key) => `<meta name="${key}" content="${meta[key]}">`)
|
||||
.join('\n');
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
export function getViteConfigForSiteDev(): InlineConfig {
|
||||
setBuildTarget('package');
|
||||
|
||||
@@ -98,6 +110,7 @@ export function getViteConfigForSiteDev(): InlineConfig {
|
||||
...siteConfig,
|
||||
title,
|
||||
baiduAnalytics,
|
||||
meta: getHTMLMeta(vantConfig),
|
||||
},
|
||||
}),
|
||||
],
|
||||
|
Reference in New Issue
Block a user