File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import { generateSidebar } from "./plugins/sidebar";
33
44import { createAutoGeneratePostsPlugin } from "./plugins/posts" ;
55
6+ const isProduction = process . env . NODE_ENV === "production" ;
7+
68const GOOGLE_ANALYTICS_ID = "G-3XM039P5E6" ;
79const NAVER_SITE_VERIFICATION_CODE = "596cb41268d676e378deaba826716cd18229d0b1" ;
810
@@ -65,18 +67,22 @@ export default defineConfig({
6567 "script" ,
6668 {
6769 async : "" ,
68- src : `https://www.googletagmanager.com/gtag/js?id=${ GOOGLE_ANALYTICS_ID } ` ,
70+ src : isProduction
71+ ? `https://www.googletagmanager.com/gtag/js?id=${ GOOGLE_ANALYTICS_ID } `
72+ : "" ,
6973 } ,
7074 ] ,
7175 [
7276 "script" ,
7377 { } ,
74- `
78+ isProduction
79+ ? `
7580 window.dataLayer = window.dataLayer || [];
7681 function gtag() { dataLayer.push(arguments); }
7782 gtag('js', new Date());
7883 gtag('config', '${ GOOGLE_ANALYTICS_ID } ');
79- ` ,
84+ `
85+ : "" ,
8086 ] ,
8187 [
8288 "meta" ,
You can’t perform that action at this time.
0 commit comments