Skip to content

Commit

Permalink
feat: add umami
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed May 6, 2024
1 parent 2334308 commit c17641f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { nodePolyfills } from 'vite-plugin-node-polyfills'
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: ['@unocss/nuxt', '@vueuse/nuxt', 'nuxt-monaco-editor'],
extends: ['nuxt-umami'],
app: {
head: {
title: 'AST Explorer',
Expand Down Expand Up @@ -57,4 +58,11 @@ export default defineNuxtConfig({
}
},
},
appConfig: {
umami: {
version: 2,
autoTrack: false,
ignoreLocalhost: true,
},
},
})
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"htmlparser2": "^9.1.0",
"nuxt": "3.11.2",
"nuxt-monaco-editor": "^1.2.9",
"nuxt-umami": "^2.6.1",
"postcss": "^8.4.38",
"serve": "^14.2.3",
"svelte": "^4.2.15",
Expand Down
10 changes: 10 additions & 0 deletions plugins/umami.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { umTrackView } from '#imports'

export default defineNuxtPlugin({
name: 'umami',
hooks: {
'app:mounted': function () {
umTrackView()
},
},
})
8 changes: 8 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 c17641f

Please sign in to comment.