File tree 2 files changed +5
-6
lines changed
modules/nuxt-module-plausible
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ console.log('📦 [load:module] nuxt-module-plausible')
4
4
// -----------------------------------------------------------------------------
5
5
import Path from 'path'
6
6
7
- import { defineNuxtModule , addPlugin } from 'nuxt/kit'
7
+ import { defineNuxtModule , addPlugin } from '@ nuxt/kit'
8
8
9
9
// ////////////////////////////////////////////////////////////////////// Config
10
10
// -----------------------------------------------------------------------------
Original file line number Diff line number Diff line change 1
1
// ///////////////////////////////////////////////////////////////////// Imports
2
2
// -----------------------------------------------------------------------------
3
- import { defineNuxtPlugin , useRuntimeConfig , useRouter } from '#imports'
4
- // import Config from '@/nuxt.config'
3
+ import { defineNuxtPlugin } from '#imports'
5
4
6
5
// ////////////////////////////////////////////////////////////////////// Export
7
6
// -----------------------------------------------------------------------------
8
- export default defineNuxtPlugin ( ( ) => {
7
+ export default defineNuxtPlugin ( ( nuxtApp ) => {
9
8
10
9
// Do not fire Plausible if not in production mode
11
10
if ( process . env . NODE_ENV !== 'production' ) {
12
11
return
13
12
}
14
13
15
- const router = useRouter ( )
16
- const config = useRuntimeConfig ( )
14
+ const router = nuxtApp . $router
15
+ const config = nuxtApp . $config . public . siteUrl
17
16
let isInitialPageLoad = true
18
17
19
18
router . afterEach ( ( to ) => {
You can’t perform that action at this time.
0 commit comments