Skip to content

Commit

Permalink
修改数据收集逻辑,只有在生产环境下才会执行clarity等
Browse files Browse the repository at this point in the history
  • Loading branch information
master1lan committed Feb 14, 2023
1 parent 1270867 commit f58c8a7
Show file tree
Hide file tree
Showing 4 changed files with 407 additions and 32 deletions.
20 changes: 2 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,12 @@
<link rel="dns-prefetch" href="https://s1.hdslb.com">
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<title>EOEFANS WEB</title>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-DTCJR7156E"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-DTCJR7156E');
</script>
<!-- Microsoft Clarity -->
<script type="text/javascript">
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "ftyk5fzt4o");
</script>
<!-- 探测代码已放入vite.config.ts内,只有在打包时才会插入。 -->
<%- injectScript %>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

</html>
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"terser": ">=5.4.0 <6.0.0",
"typescript": "^4.9.3",
"vite": "4.1.1",
"vite-plugin-compression": "^0.5.1"
"vite-plugin-compression": "^0.5.1",
"vite-plugin-html": "^3.2.0"
}
}
Loading

0 comments on commit f58c8a7

Please sign in to comment.