Skip to content

Commit

Permalink
chore: add GA plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Godofbrowser committed Nov 21, 2024
1 parent 4752fd4 commit 9473e7e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
17 changes: 15 additions & 2 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
import { viteBundler } from '@vuepress/bundler-vite'
import { defaultTheme } from '@vuepress/theme-default'
import { defineUserConfig } from 'vuepress'
import {shikiPlugin} from "@vuepress/plugin-shiki";
import { shikiPlugin } from "@vuepress/plugin-shiki";
import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics'
// import { mdEnhancePlugin } from "vuepress-plugin-md-enhance";

// Ref (default theme): https://ecosystem.vuejs.press/themes/default/markdown.html

const isProd = process.env.NODE_ENV === 'production'

const prodOnlyPlugins = []
if (isProd) {
prodOnlyPlugins.push(
googleAnalyticsPlugin({
id: 'G-77TKFH0GYP',
})
)
}

export default defineUserConfig({
title: 'Vuejs Dialog (Vue3)',
description: 'A lightweight, promise based alert, prompt and confirm dialog',
base: process.env.NODE_ENV === 'production' ? '/vuejs-dialog/' : '/',
base: isProd ? '/vuejs-dialog/' : '/',
bundler: viteBundler(),
plugins: [
...prodOnlyPlugins,
// https://ecosystem.vuejs.press/plugins/markdown/prismjs.html
// https://ecosystem.vuejs.press/plugins/markdown/shiki.html
shikiPlugin({
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@vue/test-utils": "^2.4.5",
"@vue/tsconfig": "^0.5.1",
"@vuepress/bundler-vite": "^2.0.0-rc.15",
"@vuepress/plugin-google-analytics": "2.0.0-rc.54",
"@vuepress/plugin-shiki": "^2.0.0-rc.42",
"@vuepress/theme-default": "^2.0.0-rc.42",
"eslint": "^8.49.0",
Expand Down
12 changes: 12 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9473e7e

Please sign in to comment.