Open lulifa opened 3 months 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.vue
把 defineEmit
改成 defineEmits
以下方式处理可正常运行 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安装
PS D:\Project\docs\vue-vben-admin-doc> pnpm 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.