Skip to content

fix(docs): update zeit now deployment process considering v2 #3574

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions docs/guide/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,30 +221,26 @@ npm install -g now

```json
{
"name": "my-example-app",
"type": "static",
"static": {
"public": "dist",
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"alias": "vue-example",
"files": [
"dist"
"version": 2,
"name": "my-vue-project",
"alias": "my-vue-project",
"builds": [{ "src": "package.json", "use": "@now/static-build" }],
"routes": [
{ "src": "^/js/(.*)", "dest": "/js/$1" },
{ "src": "^/css/(.*)", "dest": "/css/$1" },
{ "src": "^/img/(.*)", "dest": "/img/$1" },
{ "src": ".*", "dest": "/index.html" }
]
}
```

You can further customize the static serving behavior by consulting [Now's documentation](https://zeit.co/docs/deployment-types/static).
You can further customize the static serving behavior by consulting [Now's documentation](https://zeit.co/docs/v2/deployments/official-builders/static-build-now-static-build/).

3. Adding a deployment script in `package.json`:
3. Adding a now-build and a deploy script in `package.json`:

```json
"deploy": "npm run build && now && now alias"
"now-build": "vue-cli-service build",
"deploy": "now --public && now alias"
```

If you want to deploy publicly by default, you can change the deployment script to the following one:
Expand All @@ -255,6 +251,8 @@ npm install -g now

This will automatically point your site's alias to the latest deployment. Now, just run `npm run deploy` to deploy your app.

* Don't forget to exclude the `node_modules` folder from being uploaded to Now to enable faster deployment. To do that, add a `.nowignore` file to the root of the project directory and add node_modules to it.

### Stdlib

> TODO | Open to contribution.
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-service/lib/commands/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ module.exports = (api, options) => {

// create server
const server = new WebpackDevServer(compiler, Object.assign({
clientLogLevel: 'none',
clientLogLevel: 'silent',
historyApiFallback: {
disableDotRule: true,
rewrites: genHistoryApiFallbackRewrites(options.publicPath, options.pages)
Expand Down