Skip to content

Commit

Permalink
chore: fix vuepress plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed May 3, 2024
1 parent a5339bf commit 9f7b702
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 5 deletions.
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"typescript": "^5.3.3",
"vue": "^3.4.21",
"vuepress": "2.0.0-rc.9",
"vuepress-plugin-umami-analytics": "^1.8.1"
"vuepress-plugin-umami-analytics": "1.8.1"
},
"resolutions": {
"@vuepress/client": "2.0.0-rc.9",
Expand Down Expand Up @@ -235,5 +235,10 @@
"quantumult",
"clash",
"shadowrocket"
]
],
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
}
}
41 changes: 41 additions & 0 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/dist/server/index.js b/dist/server/index.js
index d61f6716a7b49354722aa01f45465c1f2e912006..a904b73033771abf9c92acd3cab130f8325344d9 100644
--- a/dist/server/index.js
+++ b/dist/server/index.js
@@ -1,22 +1,20 @@
import { getDirname, path } from '@vuepress/utils';
let __dirname = getDirname(import.meta.url);
-export let umamiAnalyticsPlugin = ({ doNotTrack, autoTrack, hostUrl, domains, cache, src, id, }) => app => {
- let plugin = {
- name: 'vuepress-plugin-umami-analytics',
- };
- if (app.env.isDev) {
- return plugin;
- }
+export let umamiAnalyticsPlugin = ({ doNotTrack, autoTrack, hostUrl, domains, cache, src, id, }) => {
return {
- ...plugin,
- define: {
- __UMAMI_ANALYTICS_DO_NOT_TRACK__: doNotTrack,
- __UMAMI_ANALYTICS_AUTO_TRACK__: autoTrack,
- __UMAMI_ANALYTICS_HOST_URL__: hostUrl,
- __UMAMI_ANALYTICS_DOMAINS__: domains,
- __UMAMI_ANALYTICS_CACHE__: cache,
- __UMAMI_ANALYTICS_SRC__: src,
- __UMAMI_ANALYTICS_ID__: id,
+ name: 'vuepress-plugin-umami-analytics',
+ define: app => {
+ if (!app.env.isDev) {
+ return {
+ __UMAMI_ANALYTICS_DO_NOT_TRACK__: doNotTrack,
+ __UMAMI_ANALYTICS_AUTO_TRACK__: autoTrack,
+ __UMAMI_ANALYTICS_HOST_URL__: hostUrl,
+ __UMAMI_ANALYTICS_DOMAINS__: domains,
+ __UMAMI_ANALYTICS_CACHE__: cache,
+ __UMAMI_ANALYTICS_SRC__: src,
+ __UMAMI_ANALYTICS_ID__: id,
+ };
+ }
},
clientConfigFile: path.resolve(__dirname, '../client/index.js'),
};
12 changes: 9 additions & 3 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 9f7b702

Please sign in to comment.