From b33c36341fe23b50b3c30d8740cdac5fd8c0eacb Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 22 Sep 2020 11:25:31 +0800 Subject: [PATCH] Update build-config.md --- docs/zh/guide/build-config.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/zh/guide/build-config.md b/docs/zh/guide/build-config.md index c3db3221..494c9587 100644 --- a/docs/zh/guide/build-config.md +++ b/docs/zh/guide/build-config.md @@ -64,7 +64,8 @@ const renderer = createBundleRenderer('/path/to/vue-ssr-server-bundle.json', { 请注意,在 `externals` 选项中,我们将 CSS 文件列入白名单。这是因为从依赖模块导入的 CSS 还应该由 webpack 处理。如果你导入依赖于 webpack 的任何其他类型的文件(例如 `*.vue`, `*.sass`),那么你也应该将它们添加到白名单中。 -如果你使用 `runInNewContext: 'once'` 或 `runInNewContext: true`,那么你还应该将修改 `global` 的 polyfill 列入白名单,例如 `babel-polyfill`。这是因为当使用新的上下文模式时,**server bundle 中的代码具有自己的 `global` 对象。**由于在使用 Node 7.6+ 时,在服务器并不真正需要它,所以实际上只需在客户端 entry 导入它。 +如果你使用 `runInNewContext: 'once'` 或 `runInNewContext: true`,那么你还应该将修改 `global` 的 polyfill 列入白名单,例如 `babel-polyfill`。这是因为当使用新的上下文模式时,**server bundle 中的代码具有自己的 `global` 对象。** +由于在使用 Node 7.6+ 时,在服务器并不真正需要它,所以实际上只需在客户端 entry 导入它。 ## 客户端配置 (Client Config)