Skip to content

Commit f0a5eb4

Browse files
committed
docs: translate guide > production deployment
1 parent 85bb0ca commit f0a5eb4

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

src/guide/tooling/deployment.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# Production Deployment
1+
# 実運用への展開
22

33
::: info
4-
Most of the tips below are enabled by default if you are using [Vue CLI](https://cli.vuejs.org). This section is only relevant if you are using a custom build setup.
4+
以下のヒントのほとんどは、 [Vue CLI](https://cli.vuejs.org) を使っている場合、デフォルトで有効になっています。このセクションは、カスタムビルドのセットアップを使っている場合にのみ関連します。
55
:::
66

7-
## Turn on Production Mode
7+
## プロダクションモードをオンにする
88

9-
During development, Vue provides a lot of warnings to help you with common errors and pitfalls. However, these warning strings become useless in production and bloat your app's payload size. In addition, some of these warning checks have small runtime costs that can be avoided in [production mode](https://cli.vuejs.org/guide/mode-and-env.html#modes).
9+
開発中、 Vue は一般的なエラーや落とし穴に役立つたくさんの警告を提供しています。しかし、これらの警告文は実運用では役に立たず、アプリケーションのペイロードの大きさを肥大化させてしまいます。 さらに、これらの警告チェックの中には、 [プロダクションモード](https://cli.vuejs.org/guide/mode-and-env.html#modes) では避けることのできる小さなランタイムコストがあります。
1010

11-
### Without Build Tools
11+
### ビルドツールなし
1212

13-
If you are using the full build, i.e. directly including Vue via a script tag without a build tool, make sure to use the minified version for production. This can be found in the [Installation guide](/guide/installation.html#cdn).
13+
フルビルドを使う場合、つまりビルドツールを使わずに script タグで Vue を直接含める場合は、必ず minifiled バージョンを本番で使ってください。これは、 [インストールガイド](/guide/installation.html#cdn) に記載されています。
1414

15-
### With Build Tools
15+
### ビルドツールあり
1616

17-
When using a build tool like Webpack or Browserify, the production mode will be determined by `process.env.NODE_ENV` inside Vue's source code, and it will be in development mode by default. Both build tools provide ways to overwrite this variable to enable Vue's production mode, and warnings will be stripped by minifiers during the build. Vue CLI has this pre-configured for you, but it would be beneficial to know how it is done:
17+
Webpack Browserify などのビルドツールを使う場合は、プロダクションモードは Vue のソースコード内の `process.env.NODE_ENV` で決定され、デフォルトでは開発モードになります。どちらのビルドツールも、 Vue のプロダクションモードを有効にするために、この変数を上書きする方法を提供しており、警告はビルド中に Minifier (圧縮・軽量化) によって取り除かれます。Vue CLI では事前設定されていますが、どのように行われているか知っておくことはよいでしょう:
1818

1919
#### Webpack
2020

21-
In Webpack 4+, you can use the `mode` option:
21+
Webpack 4+ では、 `mode` オプションを使えます:
2222

2323
```js
2424
module.exports = {
@@ -28,45 +28,45 @@ module.exports = {
2828

2929
#### Browserify
3030

31-
- Run your bundling command with the actual `NODE_ENV` environment variable set to `"production"`. This tells `vueify` to avoid including hot-reload and development related code.
31+
- 実際の `NODE_ENV` 環境変数に `"production"` を設定して、バンドルコマンドを実行してください。これは `vueify` にホットリロードや開発関連のコードを含まないように指示します。
3232

33-
- Apply a global [envify](https://github.com/hughsk/envify) transform to your bundle. This allows the minifier to strip out all the warnings in Vue's source code wrapped in env variable conditional blocks. For example:
33+
- バンドルにグローバルな [envify](https://github.com/hughsk/envify) の変換を適用します。これにより、 Minifier は環境変数の条件ブロックに含まれた Vue のソースコードのすべての警告を取り除くことができます。例えば:
3434

3535
```bash
3636
NODE_ENV=production browserify -g envify -e main.js | uglifyjs -c -m > build.js
3737
```
3838

39-
- Or, using [envify](https://github.com/hughsk/envify) with Gulp:
39+
- または、 [envify](https://github.com/hughsk/envify) Gulp で使うと:
4040

4141
```js
42-
// Use the envify custom module to specify environment variables
42+
// envify のカスタムモジュールで環境変数を指定
4343
const envify = require('envify/custom')
4444

4545
browserify(browserifyOptions)
4646
.transform(vueify)
4747
.transform(
48-
// Required in order to process node_modules files
48+
// node_modules ファイルを処理するために必要
4949
{ global: true },
5050
envify({ NODE_ENV: 'production' })
5151
)
5252
.bundle()
5353
```
5454

55-
- Or, using [envify](https://github.com/hughsk/envify) with Grunt and [grunt-browserify](https://github.com/jmreidy/grunt-browserify):
55+
- または、 [envify](https://github.com/hughsk/envify) Grunt [grunt-browserify](https://github.com/jmreidy/grunt-browserify) で使うと:
5656

5757
```js
58-
// Use the envify custom module to specify environment variables
58+
// envify のカスタムモジュールで環境変数を指定
5959
const envify = require('envify/custom')
6060

6161
browserify: {
6262
dist: {
6363
options: {
64-
// Function to deviate from grunt-browserify's default order
64+
// grunt-browserify のデフォルトの順序からはずれる関数
6565
configure: (b) =>
6666
b
6767
.transform('vueify')
6868
.transform(
69-
// Required in order to process node_modules files
69+
// node_modules ファイルを処理するために必要
7070
{ global: true },
7171
envify({ NODE_ENV: 'production' })
7272
)
@@ -78,7 +78,7 @@ module.exports = {
7878

7979
#### Rollup
8080

81-
Use [@rollup/plugin-replace](https://github.com/rollup/plugins/tree/master/packages/replace):
81+
[@rollup/plugin-replace](https://github.com/rollup/plugins/tree/master/packages/replace) を使ってください:
8282

8383
```js
8484
const replace = require('@rollup/plugin-replace')
@@ -93,24 +93,24 @@ rollup({
9393
}).then(...)
9494
```
9595

96-
## Pre-Compiling Templates
96+
## テンプレートのプリコンパイル
9797

98-
When using in-DOM templates or in-JavaScript template strings, the template-to-render-function compilation is performed on the fly. This is usually fast enough in most cases, but is best avoided if your application is performance-sensitive.
98+
DOM 内のテンプレートや、 JavaScript 内のテンプレートリテラルを使う場合、テンプレートからレンダリング関数へのコンパイルは実行時に行われます。ほとんどの場合、この方法で十分な速度が得られますが、アプリケーションがパフォーマンスを重視される場合は避けたほうがよいです。
9999

100-
The easiest way to pre-compile templates is using [Single-File Components](/guide/single-file-component.html) - the associated build setups automatically performs pre-compilation for you, so the built code contains the already compiled render functions instead of raw template strings.
100+
テンプレートをプリコンパイルする最も簡単な方法は、 [単一ファイルコンポーネント](/guide/single-file-component.html) を使うことです。これは関連するビルドセットアップが自動的にプリコンパイルを行います。これにより、ビルドされたコードは生のテンプレート文字列ではなく、すでにコンパイルされたレンダリング関数が含まれることになります。
101101

102-
If you are using Webpack, and prefer separating JavaScript and template files, you can use [vue-template-loader](https://github.com/ktsn/vue-template-loader), which also transforms the template files into JavaScript render functions during the build step.
102+
Webpack を使っていて、 JavaScript とテンプレートファイルを分離したい場合は、 [vue-template-loader](https://github.com/ktsn/vue-template-loader) を使うと、ビルドステップでテンプレートファイルを JavaScript のレンダリング関数に変換することもできます。
103103

104-
## Extracting Component CSS
104+
## コンポーネントの CSS を抽出
105105

106-
When using Single-File Components, the CSS inside components are injected dynamically as `<style>` tags via JavaScript. This has a small runtime cost, and if you are using server-side rendering it will cause a "flash of unstyled content". Extracting the CSS across all components into the same file will avoid these issues, and also result in better CSS minification and caching.
106+
単一ファイルコンポーネントを使う場合、コンポーネント内の CSS は JavaScript を介して `<style>` タグとして動的に差し込まれます。これにはわずかなランタイムコストがかかります。また、サーバーサイドレンダリングを使っている場合は、「瞬間的にスタイルのないコンテンツ」を引き起こします。同じファイルにすべてのコンポーネントの CSS を抽出することで、このような問題を回避して、よりよい CSS の最小化やキャッシュ化をすることができます。
107107

108-
Refer to the respective build tool documentations to see how it's done:
108+
その方法については、各ビルドツールのドキュメントを参照してください:
109109

110-
- [Webpack + vue-loader](https://vue-loader.vuejs.org/en/configurations/extract-css.html) (the `vue-cli` webpack template has this pre-configured)
110+
- [Webpack + vue-loader](https://vue-loader.vuejs.org/en/configurations/extract-css.html) (`vue-cli` の Webpack テンプレートには、これがあらかじめ設定されています)
111111
- [Browserify + vueify](https://github.com/vuejs/vueify#css-extraction)
112112
- [Rollup + rollup-plugin-vue](https://rollup-plugin-vue.vuejs.org/)
113113

114-
## Tracking Runtime Errors
114+
## ランタイムエラーの追跡
115115

116-
If a runtime error occurs during a component's render, it will be passed to the global `app.config.errorHandler` config function if it has been set. It might be a good idea to leverage this hook together with an error-tracking service like [Sentry](https://sentry.io), which provides [an official integration](https://sentry.io/for/vue/) for Vue.
116+
コンポーネントのレンダリング中にランタイムエラーが発生した場合、グローバルの `app.config.errorHandler` に設定した関数があれば、それに渡されます。Vue の [公式インテグレーション](https://sentry.io/for/vue/) を提供している [Sentry](https://sentry.io) のようなエラー追跡サービスと一緒にこのフックを活用するのはよいアイデアかもしれません。

0 commit comments

Comments
 (0)