背景
项目结构:Vue2 与 Vue3 共存的组件库,采用 pnpm workspace Monorepo 方式组织仓库。
由于项目中有 Vue2 与 Vue3 的组件,因此需要搭两套文档,Vitepress 与 Vuepress2+只支持 Vue3 的宿主环境,Vue2 的组件库文档只能使用 Vuepress1.x 搭建。
依赖这块,package.json 中以 vue3 为主,vue2 通过别名的方式安装与引用。
//package.json
{
"devDependencies": {
"vue": "^3.3.4",
"vue2": "npm:vue@2.7.15"
}
}
大约 3 分钟