diff --git a/docs/docs/babel.md b/docs/docs/babel.md index 218507c18..e377c60a3 100644 --- a/docs/docs/babel.md +++ b/docs/docs/babel.md @@ -2,29 +2,24 @@ title: Babel --- -Gatsby uses the phenomenal project [Babel](https://babeljs.io/) to enable -support for writing modern JavaScript — while still supporting older browsers. +Gatsby は [Babel](https://babeljs.io/) という素晴らしいプロジェクトを使っており、モダンな JavaScript をサポートしていない古いブラウザーへのサポートをしつつ、モダンな JavaScript の記述が可能です。 -## How to specify which browsers to support +## サポートするブラウザーをどのように指定するのか -Gatsby supports by default the last two versions of major browsers, IE 9+, as well as -any browser that still has 1%+ browser share. +Gatsby はデフォルトでメジャーなブラウザーの最新の 2 つのバージョンと IE9 以上 、そして 1% 以上のシェアがあるブラウザーをサポートしています。 -This means that your JavaScript is automatically compiled to ensure it works on older browsers. -Polyfills are also automatically added — no more shipping code which mysteriously -breaks on older browsers! +つまり JavaScript は自動的にコンパイルされ、古いブラウザー上でも動作が保証されているということです。 +ポリフィルも自動的に追加されるため、コードが古いブラウザー上で不可解に壊れることはもうありません! -If you only target newer browsers, see the [Browser -Support](/docs/browser-support/) docs page for how to instruct Gatsby on which -browsers you support and then Babel will start compiling for only these -browsers. +もし、新しいブラウザーのみの対応で良いなら、[サポートするブラウザー](/docs/browser-support/)のページをご覧ください。 +どのように Gatsby を設定すれば 、あなたがサポートしたいブラウザーのみを Babel がコンパイルしてくれるのか記載しています。 -## How to use a custom .babelrc file +## どのようにカスタム .babelrc ファイルを使うか -Gatsby ships with a default .babelrc setup that should work for most sites. If you'd like -to add custom Babel presets or plugins, you can create your own `.babelrc` at the root of -your site, import [`babel-preset-gatsby`](https://github.com/gatsbyjs/gatsby/tree/master/packages/babel-preset-gatsby), -and add additional plugins, presets, and pass options to `babel-preset-gatsby`, e.g. `targets`. +Gatsby には、ほとんどのサイトで動くようなデフォルトの .babelrc ファイルがセットアップされています。 +もしあなたが Babel のプリセットやプラグインをカスタムしたい場合、ご自身専用の `.babelrc` をサイトのルートに作成してください。 +そして [`babel-preset-gatsby`](https://github.com/gatsbyjs/gatsby/tree/master/packages/babel-preset-gatsby) をインポートし、 +プラグインやプリセットを追加後、例えば `babel-preset-gatsby` へ `targets` のように値を設定してください。 ```shell npm install --save-dev babel-preset-gatsby @@ -48,4 +43,4 @@ npm install --save-dev babel-preset-gatsby ``` -For more advanced configurations, you can also copy the defaults from [`babel-preset-gatsby`](https://github.com/gatsbyjs/gatsby/tree/master/packages/babel-preset-gatsby) and customize them to suit your needs. +より高度な設定をしたければ、 [`babel-preset-gatsby`](https://github.com/gatsbyjs/gatsby/tree/master/packages/babel-preset-gatsby) からデフォルト値をコピーし、必要に応じてカスタマイズすることも出来ます。