vssue icon indicating copy to clipboard operation
vssue copied to clipboard

[Question] How to integrate with Vitepress?

Open CodyBontecou opened this issue 2 years ago • 2 comments

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?

CodyBontecou avatar May 19 '22 03:05 CodyBontecou

This works for me:

rm -rf node_modules/.vite

ForkKILLET avatar Jun 11 '22 07:06 ForkKILLET

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

Perrywzp avatar Jan 04 '24 11:01 Perrywzp