Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update: deployment.md #4152

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
77 changes: 76 additions & 1 deletion docs/guide/deployment.md
Expand Up @@ -261,7 +261,82 @@ npm install -g now

### Heroku

> TODO | Open to contribution.
Make sure you have [heroku-cli](https://devcenter.heroku.com/articles/heroku-cli#download-and-install) installed

##### Required package
Install `serve`
```bash
yarn add serve
```
or
```bash
npm install serve
```

#### Configuration
- Create `serve.json` file in your project root

```javascript
// serve.json

{
"public": "dist",
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
```

- Set `scripts.start` to `npx serve` in package.json

```javascript
// package.json

{
...
"scripts": {
"start": "npx serve",
...
}
}
```

or

- Download [deploy.sh](https://github.com/matscode/deploy-static-sites-with-url-rewrite/blob/master/deploy.sh)

- Set `scripts.start` to `sh deploy.sh` in package.json

```javascript
// package.json

{
...
"scripts": {
"start": "sh deploy.sh",
...
}
}
```

#### Test and|or Deploy
- Deploy
```bash
// test your app locally

heroku local
```
or

```bash
// deploy your app to heroku

git push heroku master
```


### Surge

Expand Down