Skip to content

Commit

Permalink
fix: dynamic import waline css, close #42
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Jul 10, 2022
1 parent b7502a7 commit 8d693d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/valaxy/client/composables/comments/waline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { useI18n } from 'vue-i18n'
import { useRoute } from 'vue-router'

import type { WalineInitOptions, WalineInstance } from '@waline/client'

import '@waline/client/dist/waline.css'
import { cdnPrefix } from '../../utils'

/**
Expand All @@ -20,6 +18,9 @@ export function useWaline(options: {} = {}, cdn = cdnPrefix) {
if (!isClient)
return

// import css
import('@waline/client/dist/waline.css')

const route = useRoute()

const { locale } = useI18n()
Expand Down
5 changes: 4 additions & 1 deletion packages/valaxy/client/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import valaxyContext from '/@valaxyjs/context'
import type { ComputedRef, InjectionKey, Ref } from 'vue'
import { computed, inject, readonly, shallowRef } from 'vue'
// import type { RouteMeta } from 'vue-router'
import type { PageData, ValaxyConfig } from '../types'
// fix build caused by pnpm
// This is likely not portable. A type annotation is necessary.
// https://github.com/microsoft/TypeScript/issues/42873
import type { PageData, ValaxyConfig } from 'valaxy/types'

/**
* parse valaxy config
Expand Down

1 comment on commit 8d693d0

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://valaxy.site as production
🚀 Deployed on https://62caa644ad5da820fff2f0af--valaxy.netlify.app

Please sign in to comment.