Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

version: v2.8.0 #1421

Merged
merged 5 commits into from
May 31, 2019
Merged
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
4 changes: 0 additions & 4 deletions de/api/components-nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ There are 3 ways to handle internal `key` prop of `<router-view/>`.
}
```

3. `watchQuery` option in page components: `boolean` or `string[]`

Queries specified in [watchQuery](/api/pages-watchquery) option will be considered on building the key. If `watchQuery` is `true`, `fullPath` is used.

- name: `string` (_introduced with Nuxt v2.4.0_)
- This prop will be set to `<router-view/>`, used to render named-view of page component.
- Default: `default`
Expand Down
4 changes: 0 additions & 4 deletions en/api/components-nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ There are 3 ways to handle internal `key` prop of `<router-view/>`.
}
```

3. `watchQuery` option in page components: `boolean` or `string[]`

Queries specified in [watchQuery](/api/pages-watchquery) option will be considered on building the key. If `watchQuery` is `true`, `fullPath` is used.

- name: `string` (_introduced with Nuxt v2.4.0_)
- This prop will be set to `<router-view/>`, used to render named-view of page component.
- Default: `default`
Expand Down
8 changes: 8 additions & 0 deletions en/api/configuration-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,14 @@ See [webpack-hot-middleware](https://github.com/glenjamin/webpack-hot-middleware
Configuration for the [html-minifier](https://github.com/kangax/html-minifier) plugin used to minify
HTML files created during the build process (will be applied for *all modes*).

## indicator

> Display build indicator for hot module replacement in development (available in `v2.8.0+`)
- Type: `Boolean`
- Default: `true`

![nuxt-build-indicator](https://user-images.githubusercontent.com/5158436/58500509-93ba0f80-8197-11e9-8524-e115c6d32571.gif)

## loaders

> Customize options of Nuxt.js integrated webpack loaders.
Expand Down
47 changes: 38 additions & 9 deletions en/api/configuration-render.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: Nuxt.js lets you customize runtime options for rendering pages
> Nuxt.js lets you customize runtime options for rendering pages

## bundleRenderer

- Type: `Object`

> Use this option to customize vue SSR bundle renderer. This option is skipped for spa mode.
Expand All @@ -30,6 +31,7 @@ Learn more about available options on [Vue SSR API Reference](https://ssr.vuejs.
It is recommended to not use this option as Nuxt.js is already providing best SSR defaults and misconfiguration might lead to SSR problems.

## etag

- Type: `Object`
- Default: `{ weak: true }`

Expand All @@ -38,6 +40,7 @@ To disable etag for pages set `etag: false`
See [etag](https://www.npmjs.com/package/etag) docs for possible options.

## compressor

- Type `Object`
- Default: `{ threshold: 0 }`

Expand All @@ -50,20 +53,24 @@ directly (f.ex. `otherComp({ myOptions: 'example' })`).
To disable compression, use `compressor: false`.

## fallback

- Type `Object`
- Default: `{ dist: {}, static: { skipUnknown: true } }`

Options for [serve-placeholder](https://github.com/nuxt/serve-placeholder) middleware.
> Options for [serve-placeholder](https://github.com/nuxt/serve-placeholder) middleware.

If you want to disable one of them or both, you can pass a falsy value.

## http2

- Type `Object`
- Default: `{ push: false, pushAssets: null }`

Activate HTTP2 push headers.
> Activate HTTP2 push headers.

You can control what links to push using `pushAssets` function.

You can control what links to push using `pushAssets` function. Eg.:
Example:
```js
pushAssets: (req, res, publicPath, preloadFiles) => preloadFiles
.filter(f => f.asType === 'script' && f.file === 'runtime.js')
Expand All @@ -75,27 +82,48 @@ Using `req` and `res` you can decide what links to push based on the request hea

The assets will be joined together with `, ` and passed as a single `Link` header.

## injectScripts

- Type: `Boolean`
- Default: `true`

> Adds the `<script>` for Nuxt bundles, set it to `false` to render pure HTML without JS (available with `2.8.0+`)

## resourceHints
- Type: `boolean`

- Type: `Boolean`
- Default: `true`

> Adds `prefetch` and `preload` links for faster initial page load time.

You may want to only disable this option if you have many pages and routes.

## ssr
- Type: `boolean`

- Type: `Boolean`
- Default: `true` on universal mode and `false` on spa mode

> Enable SSR rendering

This option is automatically set based on `mode` value if not provided.
This can be useful to dynamically enable/disable SSR on runtime after image builds. (With docker for example)
This can be useful to dynamically enable/disable SSR on runtime after image builds (with docker for example).

## ssrLog

- Type: `Boolean` | `String`
- Default: `true` in dev mode and `false` in production

> Forward server-side logs to the browser for better debugging (only available in development)

To collapse the logs, use `'collapsed'` value.

## static

- Type: `Object`
- Default: `{}`

> Configure the `static/` directory behaviour

See [serve-static](https://www.npmjs.com/package/serve-static) docs for possible options.

Additional to them, we introduced a `prefix` option which defaults to `true`.
Expand All @@ -113,20 +141,21 @@ It will add the router base to your static assets.
Some URL rewrites might not respect the prefix.

## dist

- Type: `Object`
- Default: `{ maxAge: '1y', index: false }`

The options used for serving distribution files. Only applicable in production.
> Options used for serving distribution files. Only applicable in production.

See [serve-static](https://www.npmjs.com/package/serve-static) docs for possible options.

## csp

> Use this to configure to load external resources of Content-Security-Policy

- Type: `Boolean` or `Object`
- Default: `false`

> Use this to configure to load external resources of Content-Security-Policy

Example (`nuxt.config.js`)

```js
Expand Down
3 changes: 3 additions & 0 deletions en/api/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
{ "name": "hardSource", "to": "#hardsource" },
{ "name": "hotMiddleware", "to": "#hotmiddleware" },
{ "name": "html.minify", "to": "#html-minify" },
{ "name": "indicator", "to": "#indicator" },
{ "name": "loaders", "to": "#loaders" },
{ "name": "optimization", "to": "#optimization" },
{ "name": "optimizeCSS", "to": "#optimizecss" },
Expand Down Expand Up @@ -125,8 +126,10 @@
{ "name": "compressor", "to": "#compressor" },
{ "name": "fallback", "to": "#fallback" },
{ "name": "http2", "to": "#http2" },
{ "name": "injectScripts", "to": "#injectscripts" },
{ "name": "resourceHints", "to": "#resourcehints" },
{ "name": "ssr", "to": "#ssr" },
{ "name": "ssrLog", "to": "#ssrlog" },
{ "name": "static", "to": "#static" },
{ "name": "dist", "to": "#dist" },
{ "name": "csp", "to": "#csp" }
Expand Down
2 changes: 1 addition & 1 deletion en/lang.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"iso": "en",
"docVersion": "2.6.X",
"docVersion": "2.8.X",
"links": {
"api": "API",
"blog": "Blog",
Expand Down
4 changes: 0 additions & 4 deletions es/api/components-nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ There are 3 ways to handle internal `key` prop of `<router-view/>`.
}
```

3. `watchQuery` option in page components: `boolean` or `string[]`

Queries specified in [watchQuery](/api/pages-watchquery) option will be considered on building the key. If `watchQuery` is `true`, `fullPath` is used.

- name: `string` (_introduced with Nuxt v2.4.0_)
- This prop will be set to `<router-view/>`, used to render named-view of page component.
- Default: `default`
Expand Down
4 changes: 0 additions & 4 deletions ja/api/components-nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ description: レイアウト内でページコンポーネントを表示しま
}
```

3. 各ページコンポーネントの `watchQuery` オプション: `boolean` or `string[]`

[watchQuery](/api/pages-watchquery) に設定されたクエリはキーを生成するとき考慮されます。 `watchQuery` が `true` の場合は `fullPath` が使われます。

- name:`string` (_Nuxt v2.4.0で導入されました_)
- この prop は `<router-view/>` に設定され、ページコンポーネントの名前付きビューをレンダリングするのに利用されます。
- デフォルト: `default`
Expand Down
4 changes: 0 additions & 4 deletions ko/api/components-nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ description: 레이아웃 내부의 페이지 컴포넌트를 보여줍니다.
}
```

3. 각 페이지 컴포넌트의 `watchQuery` 옵션: `boolean` or `string[]`

[watchQuery](/api/pages-watchquery) 옵션에 설정한 쿼리는 키를 생성할 때 고려됩니다. 만약 `watchQuery`가 `true`라면 `fullPath`를 사용하게 됩니다.

- name: `string` (_introduced with Nuxt v2.4.0_)
- 이 속성은 `<router-view/>`의 속성으로 설정됩니다. 페이지 컴포넌트의 named-view를 렌더링 하는데 사용됩니다.
- 기본값: `default`
Expand Down