mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-27 20:06:36 +08:00
feat(cli): add site.headHtml option
This commit is contained in:
parent
27c3cbcf89
commit
d4ab4214ef
packages/vant-cli
@ -19,6 +19,9 @@
|
||||
<meta http-equiv="Cache-Control" content="no-cache" />
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<% if (headHtml) { %>
|
||||
<%- headHtml %>
|
||||
<% } %>
|
||||
<% if (htmlWebpackPlugin.options.usingSearch) { %>
|
||||
<link
|
||||
href="https://fastly.jsdelivr.net/docsearch.js/2/docsearch.min.css"
|
||||
|
@ -19,6 +19,9 @@
|
||||
<meta http-equiv="Cache-Control" content="no-cache" />
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<% if (headHtml) { %>
|
||||
<%- headHtml %>
|
||||
<% } %>
|
||||
<% if (htmlWebpackPlugin.options.baiduAnalytics) { %>
|
||||
<script>
|
||||
// avoid to load analytics in iframe
|
||||
|
@ -15,6 +15,7 @@ import {
|
||||
|
||||
export function getSiteDevBaseConfig(): WebpackConfig {
|
||||
const vantConfig = getVantConfig();
|
||||
const headHtml = get(vantConfig, 'site.headHtml');
|
||||
const baiduAnalytics = get(vantConfig, 'site.baiduAnalytics');
|
||||
|
||||
function getSiteConfig() {
|
||||
@ -89,6 +90,7 @@ export function getSiteDevBaseConfig(): WebpackConfig {
|
||||
chunks: ['chunks', 'site-desktop'],
|
||||
template: join(__dirname, '../../site/desktop/index.html'),
|
||||
filename: 'index.html',
|
||||
headHtml,
|
||||
baiduAnalytics,
|
||||
...htmlPluginOptions,
|
||||
}),
|
||||
@ -99,6 +101,7 @@ export function getSiteDevBaseConfig(): WebpackConfig {
|
||||
chunks: ['chunks', 'site-mobile'],
|
||||
template: join(__dirname, '../../site/mobile/index.html'),
|
||||
filename: 'mobile.html',
|
||||
headHtml,
|
||||
baiduAnalytics,
|
||||
...htmlPluginOptions,
|
||||
}),
|
||||
|
Loading…
x
Reference in New Issue
Block a user