|
1 | 1 | ---
|
2 | 2 | id: create-a-new-react-app
|
3 |
| -title: Create a New React App |
| 3 | +title: 新しい React アプリを作る |
4 | 4 | permalink: docs/create-a-new-react-app.html
|
5 | 5 | redirect_from:
|
6 | 6 | - "docs/add-react-to-a-new-app.html"
|
7 | 7 | prev: add-react-to-a-website.html
|
8 | 8 | next: cdn-links.html
|
9 | 9 | ---
|
10 | 10 |
|
11 |
| -Use an integrated toolchain for the best user and developer experience. |
| 11 | +もっとも良いユーザ・開発体験を得るために統合されたツールチェインを使いましょう。 |
12 | 12 |
|
13 |
| -This page describes a few popular React toolchains which help with tasks like: |
| 13 | +このページではいくつかの人気のある React ツールチェインを説明します。これは次のようなタスクに役立ちます: |
14 | 14 |
|
15 |
| -* Scaling to many files and components. |
16 |
| -* Using third-party libraries from npm. |
17 |
| -* Detecting common mistakes early. |
18 |
| -* Live-editing CSS and JS in development. |
19 |
| -* Optimizing the output for production. |
| 15 | +* 大量のファイルとコンポーネントでスケールする |
| 16 | +* npm を通してサードパーティライブラリを利用する |
| 17 | +* よくある間違いを早期に発見する |
| 18 | +* 開発環境で CSS と JS をライブ編集する |
| 19 | +* 本番用の出力を最適化する |
20 | 20 |
|
21 |
| -The toolchains recommended on this page **don't require configuration to get started**. |
| 21 | +このページで推奨されているツールチェインは**始めるにあたって設定が不要です**。 |
22 | 22 |
|
23 |
| -## You Might Not Need a Toolchain |
| 23 | +## ツールチェインが必要ない場合 |
24 | 24 |
|
25 |
| -If you don't experience the problems described above or don't feel comfortable using JavaScript tools yet, consider [adding React as a plain `<script>` tag on an HTML page](/docs/add-react-to-a-website.html), optionally [with JSX](/docs/add-react-to-a-website.html#optional-try-react-with-jsx). |
| 25 | +あなたが上記のような問題を経験していなかったり、まだ JavasScript のツールを利用するのに慣れていない場合、[HTML ページに簡単な `<script>` タグで React を追加](/docs/add-react-to-a-website.html)することを検討してください。([JSX の利用](/docs/add-react-to-a-website.html#optional-try-react-with-jsx)も検討してみてください) |
26 | 26 |
|
27 |
| -This is also **the easiest way to integrate React into an existing website.** You can always add a larger toolchain if you find it helpful! |
| 27 | +これは**既存のウェブサイトに React を統合する最も簡単な方法**でもあります。あなたが役立つと思えばいつでもより大きなツールチェインを追加できます。 |
28 | 28 |
|
29 |
| -## Recommended Toolchains |
| 29 | +## 推奨するツールチェイン |
30 | 30 |
|
31 |
| -The React team primarily recommends these solutions: |
| 31 | +React チームは主に以下のソリューションを推奨します: |
32 | 32 |
|
33 |
| -- If you're **learning React** or **creating a new [single-page](/docs/glossary.html#single-page-application) app,** use [Create React App](#create-react-app). |
34 |
| -- If you're building a **server-rendered website with Node.js,** try [Next.js](#nextjs). |
35 |
| -- If you're building a **static content-oriented website,** try [Gatsby](#gatsby). |
36 |
| -- If you're building a **component library** or **integrating with an existing codebase**, try [More Flexible Toolchains](#more-flexible-toolchains). |
| 33 | +- **React を学習中**か、**新しい[シングルページ](/docs/glossary.html#single-page-application)アプリケーションを作成したい**場合、[Create React App](#create-react-app) を利用してください |
| 34 | +- **Node.js でサーバサイドでレンダーされたウェブサイト**を構築するなら、[Next.js](#nextjs) を試してください |
| 35 | +- **静的なコンテンツ中心のウェブサイト**を構築するなら、[Gatsby](#gatsby) を試してください |
| 36 | +- **コンポーネントライブラリ**の構築や**既存のコードベースへの統合**をするなら、[その他の柔軟なツールチェイン](#more-flexible-toolchains)を試してください |
37 | 37 |
|
38 | 38 | ### Create React App
|
39 | 39 |
|
40 |
| -[Create React App](http://github.com/facebookincubator/create-react-app) is a comfortable environment for **learning React**, and is the best way to start building **a new [single-page](/docs/glossary.html#single-page-application) application** in React. |
| 40 | +[Create React App](http://github.com/facebookincubator/create-react-app) は **React を学習する**のに快適な環境であり、React で**新しい[シングルページ](/docs/glossary.html#single-page-application)アプリケーション**を作成するのに最も良い方法です。 |
41 | 41 |
|
42 |
| -It sets up your development environment so that you can use the latest JavaScript features, provides a nice developer experience, and optimizes your app for production. You’ll need to have Node >= 6 and npm >= 5.2 on your machine. To create a project, run: |
| 42 | +開発環境をセットアップして最新の JavaScript の機能を使えるようにし、快適な開発体験を提供し、そして本番環境用の最適化を行います。あなたのマシンに Node >= 6 及び npm >= 5.2 の環境が必要です。プロジェクトを作成するには次を実行します: |
43 | 43 |
|
44 | 44 | ```bash
|
45 | 45 | npx create-react-app my-app
|
46 | 46 | cd my-app
|
47 | 47 | npm start
|
48 | 48 | ```
|
49 | 49 |
|
50 |
| ->Note |
| 50 | +>注釈 |
51 | 51 | >
|
52 |
| ->`npx` on the first line is not a typo -- it's a [package runner tool that comes with npm 5.2+](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b). |
| 52 | +>最初の行の `npx` は打ち間違いではありません -- これは [npm 5.2 から利用できるパッケージランナーツール](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b)です. |
53 | 53 |
|
54 |
| -Create React App doesn't handle backend logic or databases; it just creates a frontend build pipeline, so you can use it with any backend you want. Under the hood, it uses [Babel](http://babeljs.io/) and [webpack](https://webpack.js.org/), but you don't need to know anything about them. |
| 54 | +Create React App はバックエンドのロジックやデータベース接続は扱いません。フロントエンドのビルドパイプラインを構築するだけであり、バックエンドに関しては好きなものを組み合わせて使って構いません。内部では [Babel](http://babeljs.io/) と [webpack](https://webpack.js.org/) を利用していますが、それらについて知る必要はありません。 |
55 | 55 |
|
56 |
| -When you're ready to deploy to production, running `npm run build` will create an optimized build of your app in the `build` folder. You can learn more about Create React App [from its README](https://github.com/facebookincubator/create-react-app#create-react-app-) and the [User Guide](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#table-of-contents). |
| 56 | +本番環境にデプロイする準備ができたら、`npm run build` を実行すれば、`build` フォルダ内に最適化されたアプリケーションのビルドが生成されます。Create React App の詳細については、[該当ツールの README](https://github.com/facebookincubator/create-react-app#create-react-app-) および [ユーザガイド](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#table-of-contents) を参照してください。 |
57 | 57 |
|
58 | 58 | ### Next.js
|
59 | 59 |
|
60 |
| -[Next.js](https://nextjs.org/) is a popular and lightweight framework for **static and server‑rendered applications** built with React. It includes **styling and routing solutions** out of the box, and assumes that you're using [Node.js](https://nodejs.org/) as the server environment. |
| 60 | +[Next.js](https://nextjs.org/) は React を使って**静的なサイトやサーバサイドでレンダーされるアプリケーション**を構築する場合に人気のある軽量フレームワークです。すぐに使える**スタイルおよびルーティングのソリューション**を含み、サーバ環境として [Node.js](https://nodejs.org/) を利用することを想定しています。 |
61 | 61 |
|
62 |
| -Learn Next.js from [its official guide](https://nextjs.org/learn/). |
| 62 | +Next.js の[オフィシャルガイド](https://nextjs.org/learn/)を参照してください。 |
63 | 63 |
|
64 | 64 | ### Gatsby
|
65 | 65 |
|
66 |
| -[Gatsby](https://www.gatsbyjs.org/) is the best way to create **static websites** with React. It lets you use React components, but outputs pre-rendered HTML and CSS to guarantee the fastest load time. |
| 66 | +[Gatsby](https://www.gatsbyjs.org/) は React で**静的なウェブサイト**を作成するのに最も良い方法です。React コンポーネントを使用しながらも、事前レンダーされた HTML と CSS を出力することで最速のロード時間を保証します。 |
67 | 67 |
|
68 |
| -Learn Gatsby from [its official guide](https://www.gatsbyjs.org/docs/) and a [gallery of starter kits](https://www.gatsbyjs.org/docs/gatsby-starters/). |
| 68 | +Gatsby の[オフィシャルガイド](https://www.gatsbyjs.org/docs/) および [スターターキットのギャラリー](https://www.gatsbyjs.org/docs/gatsby-starters/)を参照してください。 |
69 | 69 |
|
70 |
| -### More Flexible Toolchains |
| 70 | +### その他の柔軟なツールチェイン |
71 | 71 |
|
72 |
| -The following toolchains offer more flexiblity and choice. We recommend them to more experienced users: |
| 72 | +以下のツールチェインはより大きな柔軟性や選択肢を提供します。経験豊富なユーザにこれらを推奨します。 |
73 | 73 |
|
74 |
| -- **[Neutrino](https://neutrinojs.org/)** combines the power of [webpack](https://webpack.js.org/) with the simplicity of presets, and includes a preset for [React apps](https://neutrinojs.org/packages/react/) and [React components](https://neutrinojs.org/packages/react-components/). |
| 74 | +- **[Neutrino](https://neutrinojs.org/)** は [webpack](https://webpack.js.org/) のパワーとプリセットのシンプルさを兼ね備えています。プリセットには [React アプリ](https://neutrinojs.org/packages/react/) と [React コンポーネント](https://neutrinojs.org/packages/react-components/)用のものがあります。 |
75 | 75 |
|
76 |
| -- **[nwb](https://github.com/insin/nwb)** is particularly great for [publishing React components for npm](https://github.com/insin/nwb/blob/master/docs/guides/ReactComponents.md#developing-react-components-and-libraries-with-nwb). It [can be used](https://github.com/insin/nwb/blob/master/docs/guides/ReactApps.md#developing-react-apps-with-nwb) for creating React apps, too. |
| 76 | +- **[nwb](https://github.com/insin/nwb)** は [npm で React コンポーネントを公開する](https://github.com/insin/nwb/blob/master/docs/guides/ReactComponents.md#developing-react-components-and-libraries-with-nwb)ことに特に優れています。React アプリを作成するのにも[利用](https://github.com/insin/nwb/blob/master/docs/guides/ReactApps.md#developing-react-apps-with-nwb)できます。 |
77 | 77 |
|
78 |
| -- **[Parcel](https://parceljs.org/)** is a fast, zero configuration web application bundler that [works with React](https://parceljs.org/recipes.html#react). |
| 78 | +- **[Parcel](https://parceljs.org/)** は高速な、ゼロ設定のウェブアプリケーションバンドラであり、[React と共に利用](https://parceljs.org/recipes.html#react)できます。 |
79 | 79 |
|
80 |
| -- **[Razzle](https://github.com/jaredpalmer/razzle)** is a server-rendering framework that doesn't require any configuration, but offers more flexibility than Next.js. |
| 80 | +- **[Razzle](https://github.com/jaredpalmer/razzle)** は設定不要のサーバレンダリングフレームワークでありながら、Next.js よりも柔軟性があります。 |
81 | 81 |
|
82 |
| -## Creating a Toolchain from Scratch |
| 82 | +## ゼロからツールチェインを作成する |
83 | 83 |
|
84 |
| -A JavaScript build toolchain typically consists of: |
| 84 | +JavaScript ビルドツールチェインは一般的に次から成ります: |
85 | 85 |
|
86 |
| -* A **package manager**, such as [Yarn](https://yarnpkg.com/) or [npm](https://www.npmjs.com/). It lets you take advantage of a vast ecosystem of third-party packages, and easily install or update them. |
| 86 | +* **パッケージマネジャ**。[Yarn](https://yarnpkg.com/) や [npm](https://www.npmjs.com/) など。サードパーティのパッケージの広大なエコシステムを利用でき、それらを簡単にインストールしたりアップデートしたりできます。 |
87 | 87 |
|
88 |
| -* A **bundler**, such as [webpack](https://webpack.js.org/) or [Parcel](https://parceljs.org/). It lets you write modular code and bundle it together into small packages to optimize load time. |
| 88 | +* **バンドラ**。[webpack](https://webpack.js.org/) や [Parcel](https://parceljs.org/) など。モジュール化されたコードを書けるようになり、それを小さなパッケージにまとめてバンドルしてロード時間の最適化を行います。 |
89 | 89 |
|
90 |
| -* A **compiler** such as [Babel](http://babeljs.io/). It lets you write modern JavaScript code that still works in older browsers. |
| 90 | +* **コンパイラ**。[Babel](http://babeljs.io/) など。未だ動作している古いブラウザでもモダンな JavaScript コードを書いて動作させることができます。 |
91 | 91 |
|
92 |
| -If you prefer to set up your own JavaScript toolchain from scratch, [check out this guide](https://blog.usejournal.com/creating-a-react-app-from-scratch-f3c693b84658) that re-creates some of the Create React App functionality. |
| 92 | +ゼロから独自の JavaScript ツールチェインを設定したい場合、[こちらのガイドをチェック](https://blog.usejournal.com/creating-a-react-app-from-scratch-f3c693b84658)すると Create React App の機能の一部を再現できます。 |
93 | 93 |
|
94 |
| -Don't forget to ensure your custom toolchain [is correctly set up for production](/docs/optimizing-performance.html#use-the-production-build). |
| 94 | +カスタムしたツールチェインは忘れずに[本番環境用に正しく設定](/docs/optimizing-performance.html#use-the-production-build)してください。 |
0 commit comments