]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: analytics
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 24 Mar 2021 15:58:43 +0000 (16:58 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 24 Mar 2021 15:58:53 +0000 (16:58 +0100)
docs/.vitepress/config.js

index f0b2cacd8d67f55809f813f16e32060dc102eabe..eef639a306659afce322bf4c7fb8fa26a50221f4 100644 (file)
@@ -6,6 +6,21 @@ const META_DESCRIPTION =
   'Intuitive, type safe, light and flexible Store for Vue'
 const META_IMAGE = 'https://pinia.esm.dev/social.png'
 
+const isProduction = process.env.NODE_ENV
+/**
+ * @type {import('vitepress').UserConfig['head']}
+ */
+const productionHead = [
+  [
+    'script',
+    {
+      src: 'https://unpkg.com/thesemetrics@latest',
+      async: '',
+      type: 'text/javascript',
+    },
+  ],
+]
+
 /**
  * @type {import('vitepress').UserConfig}
  */
@@ -95,6 +110,7 @@ module.exports = {
         onload: "this.onload=null;this.rel='stylesheet'",
       },
     ],
+    ...(isProduction ? productionHead : []),
   ],
   themeConfig: {
     repo: 'posva/pinia',