Skip to content

Commit

Permalink
chore: Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Jan 6, 2021
2 parents 8177753 + 3eaef4d commit 89774a2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/guide/cli-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ npx vue-cli-service help [command]

## Skipping Plugins

Sometimes, you may want to not use a certain CLI Plugin when running a command. For example you might want to build a version of your app that doesn't include the PWA plugin. You can do that by passing the name of the plugin to the `--skip-plugins` option.
You can exclude specific plugins when running a command by passing the name of the plugin to the `--skip-plugins` option:

```bash
npx vue-cli-service build --skip-plugins pwa
Expand Down
22 changes: 19 additions & 3 deletions docs/guide/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,31 @@ Commit both the `.gitlab-ci.yml` and `vue.config.js` files before pushing to you
Also checkout [vue-cli-plugin-netlify-lambda](https://github.com/netlify/vue-cli-plugin-netlify-lambda).
In order to receive direct hits using `history mode` on Vue Router, you need to create a file called `_redirects` under `/public` with the following content:
#### Use history mode on Vue Router
In order to receive direct hits using `history mode` on Vue Router, you need to redirect all trafic to the `/index.html` file.
> More information on [Netlify redirects documentation](https://docs.netlify.com/routing/redirects/rewrites-proxies/#history-pushstate-and-single-page-apps).
##### Recomended method
Create a file called `netlify.toml` in the root of your repository with the following content:
```toml
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
```
##### Alternative method
Create a file called `_redirects` under `/public` with the following content:
```
# Netlify settings for single-page application
/* /index.html 200
```
More information on [Netlify redirects documentation](https://www.netlify.com/docs/redirects/#history-pushstate-and-single-page-apps).
If you are using [@vue/cli-plugin-pwa](https://cli.vuejs.org/core-plugins/pwa.html#vue-cli-plugin-pwa) make sure to exclude the `_redirects` file from being cached by the service worker.
To do so, add the following to your `vue.config.js`:
```javascript
Expand Down

0 comments on commit 89774a2

Please sign in to comment.