Vuepress inside and integrated with Vue project

2019-07-29 18:39发布

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条回答
Juvenile、少年°
2楼-- · 2019-07-29 18:58

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  
查看更多
登录 后发表回答