Skip to content
Closed
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
61 changes: 2 additions & 59 deletions docs/guide/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,66 +276,9 @@ npm install -g now
npm install now
```

2. Add a `now.json` file to your project root:

```json
{
"name": "my-example-app",
"version": 2,
"builds": [
{
"src": "package.json",
"use": "@now/static-build"
}
],
"routes": [
{
"src": "/(js|css|img)/.*",
"headers": { "cache-control": "max-age=31536000, immutable" }
},
{ "handle": "filesystem" },
{ "src": ".*", "dest": "/" }
],
"alias": "example.com"
}
```

If you have different/additional folders, modify the route accordingly:

```diff
- {
- "src": "/(js|css|img)/.*",
- "headers": { "cache-control": "max-age=31536000, immutable" }
- }
+ {
+ "src": "/(js|css|img|fonts|media)/.*",
+ "headers": { "cache-control": "max-age=31536000, immutable" }
+ }
```

If your `outputDir` is not the default `dist`, say `build`:

```diff
- {
- "src": "package.json",
- "use": "@now/static-build"
- }
+ {
+ "src": "package.json",
+ "use": "@now/static-build",
+ "config": { "distDir": "build" }
+ }
```

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

```json
"now-build": "npm run build"
```

To make a deployment, run `now`.
2. Run `now` command inside `vue-cli` app.

If you want your deployment aliased, run `now --target production` instead.
More info at [Now docs](https://zeit.co/docs).

### Stdlib

Expand Down