docs: avoid to load analytics in iframe (#4300)

This commit is contained in:
neverland 2019-08-30 14:41:52 +08:00 committed by GitHub
parent 706e513725
commit a94d49f12a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

View File

@ -3,8 +3,6 @@ const config = require('./webpack.dev.js');
const isMinify = process.argv.indexOf('-p') !== -1; const isMinify = process.argv.indexOf('-p') !== -1;
delete config.serve;
module.exports = Object.assign(config, { module.exports = Object.assign(config, {
mode: 'production', mode: 'production',
entry: { entry: {

View File

@ -10,13 +10,16 @@
<title>Vant - 轻量、可靠的移动端 Vue 组件库</title> <title>Vant - 轻量、可靠的移动端 Vue 组件库</title>
<script>window.Promise || document.write('<script src="//img.yzcdn.cn/huiyi/build/h5/js/pinkie.min.js"><\/script>');</script> <script>window.Promise || document.write('<script src="//img.yzcdn.cn/huiyi/build/h5/js/pinkie.min.js"><\/script>');</script>
<script> <script>
var _hmt = _hmt || []; // avoid to load analytics in iframe
(function() { if (window.top === window) {
var hm = document.createElement("script"); var _hmt = _hmt || [];
hm.src = "https://hm.baidu.com/hm.js?ad6b5732c36321f2dafed737ac2da92f"; (function() {
var s = document.getElementsByTagName("script")[0]; var hm = document.createElement("script");
s.parentNode.insertBefore(hm, s); hm.src = "https://hm.baidu.com/hm.js?ad6b5732c36321f2dafed737ac2da92f";
})(); var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
}
</script> </script>
</head> </head>
<body ontouchstart> <body ontouchstart>