Vuepress inside and integrated with Vue project

回眸只為那壹抹淺笑 提交于 2019-12-24 15:55:04

问题


I´m starting with Vuepress (https://vuepress.vuejs.org), and i´d followed the docs to integrate it with an existing project (https://vuepress.vuejs.org/guide/getting-started.html#inside-an-existing-project). I used the sugested docs directory.

But now i need to "really" integrate with my project and i need to when my users access the my-project.com/docs, to reach the Vuepress docs

If i make (yarn docs:build), the /dist folder will be generated to be used anywhere as a statics HTML files. I tought in put the /dist/ content in the /static/ files of my project. But the vue-router response to /docs is a 404.

And i will still need to make 2 builds, my project and the docs.

The questions are:

  1. How can i make the vue-router "see" the vuepress build files? Where to put them?
  2. How can i integrate the run build of project to make them both?

I have 2 projects, one with quasar and the other i´m using vue-cli 3.

Thank you all.


回答1:


How can i make the vue-router "see" the vuepress build files? Where to put them?

You don't, it's basically an external link. A simple <a href="/docs"> should be sufficient.

How can i integrate the run build of project to make them both?

You don't, you add a new task that does them both.

// package.json
{
  "scripts": {
    "build-project": "node build-project.js"
  }
}

from a terminal

# yarn run build-project  


来源:https://stackoverflow.com/questions/52188342/vuepress-inside-and-integrated-with-vue-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!