0

I want to deploy my Vue.js project to a sub directory let say abc.com/sub-directory using vue.config.js enter image description here

1 Answer 1

1

If you have the same URL for both production and staging servers.

let publicPath = process.env.NODE_ENV === 'production' ? '/sub-directory' : '/sub-directory';

if you have different URLs for production and staging environments

let publicPath = process.env.NODE_ENV === 'production' ? '/' : '/sub-directory';

You can read more about the build modes and deployment here.

https://cli.vuejs.org/guide/mode-and-env.html

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the reply , should i create the sub directory folder on server , or should it create automatically
I think you will need to create it yourself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.