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

1 Answer
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.
2 Comments
Farooq khan
Thanks for the reply , should i create the sub directory folder on server , or should it create automatically
Zulqarnain Haider
I think you will need to create it yourself.