Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
Merged
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
12 changes: 6 additions & 6 deletions docs/docs/webpack-and-ssr.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
title: Webpack and SSR
title: Webpack SSR
---

Bootstrap is finished! And we've [written the resulting pages](/docs/write-pages/) to disk. The next step is to render each page to HTML. And, we must build a JavaScript runtime that takes over once the HTML has loaded so that future page navigations load instantly.
Bootstrap が完了しました!そしてディスクに[結果ページが書き込まれました](/docs/write-pages/)。次のステップでは、これらのページを HTML へレンダリングします。またページナビゲーションを即座に読み込むため、HTML が読み込まれたら引き継ぐ JavaScript ランタイムをビルドする必要があります。

The next stages of the build lean heavily on webpack for code optimization and code splitting. If you haven't already, it's worth diving into [webpack's docs](https://webpack.js.org/guides/) to learn how it works.
ビルドの次のステージは、Webpack のコード最適化とコード分割に強く依存しています。まだ読んでいないのであれば、[Webpack のドキュメント](https://webpack.js.org/guides/)から Webpack がどのように動いているか学習すると良いでしょう。

## /.cache/

All the files required by webpack are in your site's `.cache` directory. This is empty when you initialize a new project and can be safely deleted. Gatsby creates and fills it over the course of a build.
Webpack が必要とする全てのファイルは、`.cache` ディレクトリーの中にあります。このディレクトリーはプロジェクトの初期化時には空であり、安全に削除できます。Gatsby はビルドの過程でディレクトリーとそこに含まれるファイルを生成します。

At the start of the build, Gatsby [copies all files](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/bootstrap/index.js#L191) in [gatsby/cache-dir](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby/cache-dir) into your `.cache` directory. This includes things like [static-entry.js](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/cache-dir/static-entry.js) and [production-app.js](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/cache-dir/production-app.js) that you'll read about in the next sections. Essentially, all files that are needed by Gatsby to run in the browser, or to generate HTML, are included in `cache-dir`.
Gatsby はビルドの開始時、[gatsby/cache-dir](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby/cache-dir) に含まれる[全てのファイルのコピー](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/bootstrap/index.js#L191)を、`.cache` ディレクトリーに生成します。この中には、次のセクションで説明する [static-entry.js](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/cache-dir/static-entry.js) [production-app.js](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/cache-dir/production-app.js) といったものが含まれています。基本的に、ブラウザーでの実行か HTML の生成に必要なファイルは全て、`cache-dir` に含まれます。

Since Webpack doesn't know about Redux, we also need to create files that contain all the page data that was built up during bootstrap. And these all need to be placed in `.cache` as well. This is what the previous [Write Out Pages](/docs/write-pages/) section dealt with.
Webpack Redux を認識しないため、Bootstrap 中に構築された全てのページデータを含むファイルを生成する必要があります。そして、これらのファイルもすべて `.cache` に格納する必要があります。これは 1 つ前の[ページの書き出し](/docs/write-pages/)セクションで扱ったものです。