0
votes

I am using vue cli 3.6.3.

How can i build a Vue.js project for production if the project is not in the web root?

Inside the webserver the project directory is "my/web/directory"

I start the project using webpack template, and set the publicPath and ROOT_API variables:

config/prod.env.js:

'use strict'
module.exports = {
  NODE_ENV: '"production"',
  ROOT_API: '"http://www.example.com/my/web/directory/myapi/myindex.php"',
  publicPath: '/my/web/directory/'
}

After a npm run build i do upload the dist files (just inside the dist folder: static and index.html) the project point to the webserver root and did not find the js files.

How can i point to the right directory path?

1
What does the build index.html file show? You could inspect the file and see if the path /my/web/directory was added there. - ljubadr
I just find the assetsPublicPath inside the build section of the config/index.js, i do configure and now it is working fine. - Ângelo Rigo
Post it as an answer to help others - ljubadr

1 Answers

0
votes

I just find the assetsPublicPath inside the build section of the config/index.js, i do configure and now it is working fine.