From 0c95482750f6f9560924bfa8e94f1a355064d00c Mon Sep 17 00:00:00 2001 From: s15r <42869323+s15r@users.noreply.github.com> Date: Sun, 10 Mar 2019 14:13:08 +0100 Subject: [PATCH] Dokument how to setup vue on heroku --- docs/guide/deployment.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/docs/guide/deployment.md b/docs/guide/deployment.md index f6e44b250c..2ce183a5a2 100644 --- a/docs/guide/deployment.md +++ b/docs/guide/deployment.md @@ -261,7 +261,41 @@ npm install -g now ### Heroku -> TODO | Open to contribution. +1. Do the general Heroku setup, by following the instructions on [heroku](https://devcenter.heroku.com/articles/getting-started-with-nodejs). In short: +- Create heroku account https://signup.heroku.com/signup/dc +- Install the heroku CLI; login; create the heroku project +```bash +sudo snap install heroku --classic +heroku login +heroku create your-awesome-vue-app-name +``` +2. Ensure the build and start scripts are configured + - This example uses *serve* to expose the /dist directory using the dynamically provided heroku-PORT +```json +{ + "name": "your-awesome-vue-app-name", + "version": "0.1.0", + "scripts": { + "start": "./node_modules/serve/bin/serve.js -s dist/ -l $PORT", + "build": "vue-cli-service build", + "heroku-postbuild": "yarn build" + }, + "dependencies": { + "serve": "^10.1.2", + "vue": "^2.6.8" + }, + "devDependencies": { + "@vue/cli-service": "^3.4.0", + "vue-template-compiler": "^2.5.21" + }, + "heroku-run-build-script": true +} +``` + +3. Push your git repo to heroku +```bash +git push heroku master +``` ### Surge