diff --git a/docs/docs/.vitepress/config.ts b/docs/docs/.vitepress/config.ts index a88f16ae..6c95a561 100644 --- a/docs/docs/.vitepress/config.ts +++ b/docs/docs/.vitepress/config.ts @@ -40,7 +40,6 @@ export default defineConfig({ }, ], ['script', { src: 'https://unpkg.com/katex@0.15.3/dist/katex.min.js' }], - // ['script', { src: 'https://unpkg.com/@artalk/plugin-katex/dist/artalk-plugin-katex.js' }], ], lastUpdated: true, diff --git a/docs/docs/package.json b/docs/docs/package.json index f15818cb..2a1b2937 100644 --- a/docs/docs/package.json +++ b/docs/docs/package.json @@ -21,7 +21,7 @@ "vitepress": "1.1.4" }, "dependencies": { - "@artalk/plugin-katex": "^0.1.7", + "@artalk/plugin-katex": "^0.1.8", "vue": "^3.4.26" } } diff --git a/ui/plugin-katex/package.json b/ui/plugin-katex/package.json index 862c9ba7..286a0626 100644 --- a/ui/plugin-katex/package.json +++ b/ui/plugin-katex/package.json @@ -1,6 +1,6 @@ { "name": "@artalk/plugin-katex", - "version": "0.1.7", + "version": "0.1.8", "minAppVersion": "2.8.6", "license": "MIT", "description": "The katex plugin for artalk", diff --git a/ui/plugin-katex/src/main.ts b/ui/plugin-katex/src/main.ts index c18b6e1c..aadadf6d 100644 --- a/ui/plugin-katex/src/main.ts +++ b/ui/plugin-katex/src/main.ts @@ -1,6 +1,9 @@ import { ArtalkPlugin } from 'artalk' import katex from 'katex' -import 'katex/dist/katex.min.css' + +if (import.meta.env.DEV) { + import('katex/dist/katex.min.css') +} export const ArtalkKatexPlugin: ArtalkPlugin = (ctx) => { ctx.on('mounted', () => { diff --git a/ui/plugin-katex/tsconfig.json b/ui/plugin-katex/tsconfig.json index 3cd80645..aa6fcb7c 100644 --- a/ui/plugin-katex/tsconfig.json +++ b/ui/plugin-katex/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "baseUrl": ".", "outDir": "dist", - "types": ["@artalk/plugin-kit/client"] + "types": ["@artalk/plugin-kit/client", "vite/client"] } }