vbenjs / vue-vben-admin-doc

vue-vben-admin-doc
https://vbenjs.github.io/vue-vben-admin-doc
333 stars 392 forks source link

pnpm dev 报错 #159

Open lulifa opened 3 months ago

lulifa commented 3 months ago

PS D:\Project\docs\vue-vben-admin-doc> pnpm dev

vben-admin-docs@1.0.0 dev D:\Project\docs\vue-vben-admin-doc vitepress dev

vitepress v0.14.1 vite v2.9.18 (!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.

ldeng76 commented 2 months ago

同问

forose commented 2 months ago

同问啊

aixiaodoucn commented 1 month ago

我安装了几个依赖,执行build成功,执行serve可以预览了,但是dev还是报错。

"devDependencies": {
    "prettier": "^2.8.8",
    "vite-plugin-components": "^0.10.4",
    "vite-plugin-icons": "^0.6.5",
    "vite-plugin-windicss": "^1.9.3",
    "vitepress": "^0.14.1",
    "windicss": "^3.5.6"
  },
  "dependencies": {
    "@docsearch/css": "^3.6.2",
    "@docsearch/js": "^3.6.2",
    "@docsearch/react": "^3.6.2",
    "@iconify/json": "^1.1.461",
    "@vueuse/core": "^5.3.0",
    "vue": "^3.5.10"
  }

改代码:.vitepress/theme-default/components/NavBar.vuedefineEmit 改成 defineEmits

aixiaodoucn commented 1 month ago

以下方式处理可正常运行 pnpm dev: vite.config.js添加build配置项,指定入口文件。

const config: UserConfig = {
  build: {
    rollupOptions: {
      input: '.vitepress/config.js'
    }
  },
  ......
};

package.json依赖包如下


  "devDependencies": {
    "prettier": "^2.8.8",
    "vite-plugin-components": "^0.10.4",
    "vite-plugin-icons": "^0.6.5",
    "vite-plugin-windicss": "^1.9.3",
    "vitepress": "^0.14.1",
    "windicss": "^3.5.6"
  },
  "dependencies": {
    "@docsearch/css": "^3.6.2",
    "@docsearch/js": "^3.6.2",
    "@docsearch/react": "^3.6.2",
    "@iconify/json": "^1.1.461",
    "@vueuse/core": "^5.3.0",
    "@vueuse/shared": "^11.1.0",
    "vue": "^3.5.10",
    "vue-demi": "^0.14.10"
  }

我的运行环境:node18.16,pnpm9.4,依赖包使用pnpm安装