meteorlxy / vssue

:mailbox: A Vue-powered Issue-based Comment Plugin
https://vssue.js.org
MIT License
769 stars 105 forks source link

[Question] How to integrate with Vitepress? #153

Open CodyBontecou opened 2 years ago

CodyBontecou commented 2 years ago

I'm attempting to bring this into a Vitepress project with the following theme config:


import DefaultTheme from 'vitepress/dist/client/theme-default'
import 'vssue/dist/vssue.css'

import Vssue from 'vssue'
import GithubV3 from '@vssue/api-github-v3'

export default {
  ...DefaultTheme,
  enhanceApp({ app }) {
    app.component('Vssue', Vssue, {
      api: GithubV3,
      owner: 'CodyBontecou',
      repo: 'blog',
      clientId: process.env.GITHUB_CLIENT_ID,
      clientSecret: process.env.GITHUB_CLIENT_SECRET,
    })
  },
}

This gives me the errors:

Vite Error, /@fs/Users/codybontecou/Code/blog/node_modules/.vite/deps/@vssue_api-github-v3.js?v=08f3ac7d optimized info should be defined
Vite Error, /@fs/Users/codybontecou/Code/blog/node_modules/.vite/deps/vssue.js?v=f937cd3e optimized info should be defined

Even just importing Vssue or GithubV3 creates the error as well. Any ideas?

ForkKILLET commented 2 years ago

This works for me:

rm -rf node_modules/.vite
Perrywzp commented 6 months ago

难道不会出现不适配情况?如下图,这个是不是没辙,只有等vssue适配了,才能用到vitepress里了。 image