How to keep vuepress source files in custom directory?

384 views Asked by At

I tried creating ./docs/ui/.vuepress/config.js but it seems to be ignored.

The problem is I have more than one documentation platform. One is in ./docs/dev/ and the other (vuepress) will be in ./docs/ui/

I did not see a way to change the source path.

This is my config file:

module.exports = {
    base: '/docs/ui/',
    dest: '/static/docs/ui',
    title: 'Hello VuePress',
    description: 'Just playing around'
}

I want to publish to ./static/docs/ui when running docs:build

1

There are 1 answers

0
Mark Davich On

Here is what the people at VuePress say about Directory Structure

As far as "Publishing" goes, I had to add that functionality to the scripts object in package.json.

docs
├─ node_modules
├─ src
└─ package.json
{
  ...
  "scripts": {
    "dev": "vuepress dev src",
    "build": "vuepress build src",
    "copy": "xcopy /E /I /Y \"src\\.vuepress\\dist\\\" \"c:\\publish\\directory\"",
    "postbuild": "npm run copy"
  },
  ...
}

You need to add a copy and postbuild property to scripts object that will copy the contents of the dist folder to a different location.

I'm using Windows hence all the fun escaping... The copy script issues the following command:
xcopy /E /I /Y "src\.vuepress\dist" "c:\publish\directory"
if that helps clarify what is happening.

If you are using Linux you might be using the cp command instead of xcopy