[Vuejs]-How to keep vuepress source files in custom directory?

0πŸ‘

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

Leave a comment