0

i build an app with "npm run build". dist-folder created successfully. Then i uploaded the dist folder and index.html to the right path on my hosting server (m.myapp2go/vueapp/dist) with a ftp-client. Now there is a path-problem! In the get-request "/vueapp/dist" is missing. If i call the app with http://m.myapp2go.de/vueapp/ the following error occurs in console.

enter image description here

Installation on server:

enter image description here

Do i have to set the path to deployment-server before build? And when, where can i do this? THX

2
  • the npm run build runs the build command, you can find it in your package.json. It will likely point towards some vue-cli call. Check for options there. Commented Nov 25, 2019 at 14:37
  • where can i put the path for a correct distribution of the app? Commented Nov 25, 2019 at 19:35

1 Answer 1

1

I found the solution. Perhaps a good instruction for others, with the same problem. It's a very weird topic, and the documentation for deploying to a hosted server is very inadequate in the web.

If you want to deploy e.g. to:

m.myapp2go.de/vueapp/

you have to set the vue CLI configuration in the vue ui as follows:

enter image description here

Then run

npm run build

and then copy the index.html to your root-folder on the server and your dist-folder to your dist-folder on server.

And, voilà, the test app is running perfect on the hosted server!

enter image description here

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

2 Comments

i didnt even know there was a UI for the Vue CLI, i guess the 'Basis-URL' setting is directly related to cli.vuejs.org/config/#publicpath .
@ Flame . Yes, that's correct. It is the publicPath in vue.config.js.

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.