From c9e0e46f4d3e46990f7050910fb41fd00988e2ff Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Mon, 17 Sep 2018 08:36:50 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=BF=BB=E8=AF=91=E9=81=97=E6=BC=8F?= =?UTF-8?q?=E7=9A=84=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/content/guide/universal.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aio/content/guide/universal.md b/aio/content/guide/universal.md index 42e9dcff62..e31293c88e 100644 --- a/aio/content/guide/universal.md +++ b/aio/content/guide/universal.md @@ -380,10 +380,17 @@ You can get runtime information about the current platform and the `appId` by in ### Build Destination +### 构建目标 + A Universal app is distributed in two parts: the server-side code that serves up the initial application, and the client-side code that's loaded in dynamically. +Universal 应用分为两个部分:提供初始应用的服务端代码,以及动态加载的客户端代码。 + The Angular CLI outputs the client-side code in the `dist` directory by default, so you modify the `outputPath` for the __build__ target in the `angular.json` to keep the client-side build outputs separate from the server-side code. The client-side build output will be served by the Express server. +Angular CLI 默认会输出 `dist` 目录中的客户端代码,因此你要修改 `angular.json` 中**构建目标**的 `outputPath`,来把客户端的构建目标和服务端的分开。 +客户端构建的输出将会用 Express 提供服务。 + ``` ... "build": { @@ -851,6 +858,8 @@ Now that you've created the TypeScript and Webpack config files and configured t First add the _build_ and _serve_ commands to the `scripts` section of the `package.json`: +首先在 `package.json` 的 `scripts` 区添加 `build` 和 `serve` 命令: + ``` "scripts": { ...