Skip to content

Commit

Permalink
chore(plugins): fix window not defined issue for plugin-kit
Browse files Browse the repository at this point in the history
  • Loading branch information
qwqcode committed May 30, 2024
1 parent 630a3b1 commit d7a0707
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"vitepress": "1.1.4"
},
"dependencies": {
"@artalk/plugin-katex": "^0.1.8",
"@artalk/plugin-katex": "^0.1.9",
"vue": "^3.4.26"
}
}
6 changes: 2 additions & 4 deletions ui/plugin-katex/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@artalk/plugin-katex",
"version": "0.1.8",
"version": "0.1.9",
"minAppVersion": "2.8.6",
"license": "MIT",
"description": "The katex plugin for artalk",
Expand All @@ -14,9 +14,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview",
"prepublish": "pnpm build",
"publish": "pnpm publish --access=public"
"serve": "vite preview"
},
"dependencies": {
"artalk": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion ui/plugin-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@artalk/plugin-kit",
"version": "1.0.0",
"version": "1.0.1",
"description": "The plugin kit for Artalk",
"type": "module",
"main": "dist/main.js",
Expand Down
2 changes: 1 addition & 1 deletion ui/plugin-kit/src/plugin/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const ViteArtalkPluginKit = (opts: ViteArtalkPluginKitOptions = {}): Plug
return {
code: `${code}
// Mount plugin to browser window global
if (window) {
if (typeof window !== 'undefined') {
!window.ArtalkPlugins && (window.ArtalkPlugins = {})
window.ArtalkPlugins.${ctx.entryExportName} = ${ctx.entryExportName}
window.Artalk?.use(${ctx.entryExportName})
Expand Down

0 comments on commit d7a0707

Please sign in to comment.