-3

I have been playing with the Vue for few months and i really loved it. I am using the webstorm as an editor, it has all the pre-installed templates for the Vue and other frameworks and the development was really fun with the Vue. Anyway, when i decided to deploy the app on Heroku, it didn't work. When i run the project on my local machine it works fine but when i deploy on the Heroku, i get an empty page. I googled for the solution and i found out there should be some dist folder that i never had, even on my local machine i can't find this folder. For now, i have these folders:

enter image description here

My question, do i have to create DIST folder and move there the index.html and some other files? Do i have to run the npm build(i did and nothing actully happened). Here is my p.json:

"scripts": {
        "postinstall": "npm install express",
        "start": "node server.js"
},
      "dependencies": {
        "vue": "^2.5.2"
},

so what i do wrong and how i make my app work? Thx

  • whats in build? It sounds like your expecting magic to happen just because its vue, what build/bundling tools are you using? Whats in server etc etc – Lawrence Cherone Aug 20 '18 at 23:47
  • 1
    `npm run build`, also see https://vuejs.org/v2/guide/deployment.html – connexo Aug 20 '18 at 23:49
  • 1
    Are you using any of these Vue templates? https://github.com/vuejs-templates – connexo Aug 20 '18 at 23:53
  • I am not expecting any magic to happen, i just want to know how to deploy the app online. Somehow on my machine, it's working fine when i run `npm run`, but when i push to Heroku i have an empty page. I have tried the npm run build but it does nothing. –  Aug 21 '18 at 00:03
  • I guess the best way to create a Vue project with the command line and not with the editor. I just followed this answer and i have what i need [how-to-deploy-vue-app](https://stackoverflow.com/questions/42936588/how-to-deploy-vue-app) –  Aug 21 '18 at 00:36

1 Answers1

0

You need to create a final version. If you use cli vue version 3, you can use command vue-cli-service build. Link: https://cli.vuejs.org/guide/build-targets.html#library

After build project you can download folder dist in heroky (or example surge.sh) and visit you site online.

Good luck.