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